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

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.

主站蜘蛛池模板: 聊城市| 翁牛特旗| 汪清县| 金华市| 红桥区| 崇义县| 青海省| 舒兰市| 潮安县| 沛县| 德昌县| 台北县| 龙泉市| 兴宁市| 云龙县| 乌鲁木齐市| 九龙县| 垦利县| 枝江市| 道孚县| 沅陵县| 万荣县| 贵南县| 开阳县| 桃源县| 安福县| 鲁山县| 西乌珠穆沁旗| 逊克县| 中西区| 巴南区| 武强县| 盐边县| 通榆县| 哈密市| 景洪市| 石柱| 团风县| 阜新市| 乌鲁木齐县| 金沙县|