Learn Ansible
上QQ阅读APP看书,第一时间看更新

Updating packages

First of all, let's update our server by adding the following to the beginning of the roles/common/tasks/main.yml file:

- name: update all of the installed packages
yum:
name: "*"
state: "latest"
update_cache: "yes"

You will notice that there is a difference from when we last ran yum to update all of the installed packages and that is what we are now doing is starting the task using the name key, this will print out the content of the value we assigned to the name key when the playbook runs, which will give us a better idea of what is going on during the playbook run.