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

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.

主站蜘蛛池模板: 多伦县| 吐鲁番市| 永嘉县| 井陉县| 宜章县| 肃宁县| 繁峙县| 南平市| 随州市| 斗六市| 阳原县| 常山县| 高碑店市| 卢龙县| 葵青区| 兖州市| 东明县| 吴桥县| 临高县| 宁都县| 山阴县| 得荣县| 仁寿县| 亳州市| 大兴区| 新乡县| 柏乡县| 北海市| 阿勒泰市| 靖边县| 黔东| 阳春市| 边坝县| 黑山县| 都江堰市| 哈巴河县| 太湖县| 思茅市| 延庆县| 宁河县| 朝阳县|