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

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.

主站蜘蛛池模板: 隆回县| 横峰县| 海门市| 东至县| 铁岭县| 迁安市| 威海市| 山西省| 亚东县| 星子县| 乌鲁木齐市| 大名县| 石棉县| 扶余县| 安塞县| 富阳市| 乐都县| 潮安县| 运城市| 兴文县| 柳河县| 山东| 宜宾市| 景宁| 伊金霍洛旗| 保山市| 海淀区| 平原县| 四川省| 堆龙德庆县| 根河市| 新绛县| 金平| 疏勒县| 玛曲县| 德保县| 枣强县| 涿鹿县| 遵化市| 桐梓县| 新兴县|