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

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.

主站蜘蛛池模板: 镇江市| 泾川县| 察雅县| 邹平县| 镇原县| 虞城县| 贵港市| 修文县| 武威市| 佛山市| 福清市| 广灵县| 民权县| 桦川县| 论坛| 柳州市| 建德市| 丰宁| 河南省| 天津市| 府谷县| 屯昌县| 宁阳县| 元朗区| 祁东县| 溧水县| 防城港市| 安图县| 上蔡县| 满城县| 漳浦县| 永胜县| 育儿| 洛浦县| 疏附县| 准格尔旗| 阜宁县| 桦南县| 平和县| 佳木斯市| 鄢陵县|