Now that we have updated the installed packages, let's install the packages we want to install on all of the Linux servers we will be launching:
- name: install the common packages yum: name: "{{ item }}" state: "installed" with_items: "{{ common_packages }}"
As you can see, we are again using the yum module and we have added a descriptive name for the task. Rather than providing a list of packages in the task, we are using a variable called common_packages, which is defined in the roles/common/defaults/main.yml file as the following:
common_packages: - "ntp" - "ntpdate" - "vim-enhanced" - "git" - "unzip" - "policycoreutils-python" - "epel-release" - "https://centos7.iuscommunity.org/ius-release.rpm"
As you can ...