官术网_书友最值得收藏!

Upgrading all installed packages

To upgrade all installed packages, we will need to use the yum module again, but with a different parameter; in fact, we would use the following:

- name: Ensure we have last version of every package 
  yum: 
    name: "*" 
    state: latest 
  become: True 

As you can see, we have specified * as the package name (this stands for a wildcard to match all installed packages) and the state parameter is latest. This will upgrade all installed packages to the latest version available.

You may remember that, when we talked about the present state, we said that it was going to install the last available version. So, what's the difference between present and latest? present will install the latest version if the package is not installed, while if the package is already installed (no matter the version), it will go forward without making any change. latest will install the latest version if the package is not installed, and if the package is already installed, it will check whether a newer version is available, and, if it is, Ansible will update the package.

主站蜘蛛池模板: 鹤山市| 嘉鱼县| 长垣县| 云安县| 永修县| 泾川县| 南丹县| 汉川市| 南郑县| 遂川县| 许昌市| 县级市| 松溪县| 鄢陵县| 遂昌县| 秭归县| 吉水县| 南陵县| 黑龙江省| 吉安县| 樟树市| 兰西县| 扎兰屯市| 通化县| 密山市| 唐海县| 唐山市| 莎车县| 临洮县| 汾西县| 临城县| 绥宁县| 四平市| 镇巴县| 禹州市| 静海县| 澄迈县| 盖州市| 张掖市| 锦州市| 晋江市|