Enabling the repositories

Let's start our playbook by enabling the three repositories we need in order to install our software stack and then, once those repositories are enabled, we should do a yum update to make sure that the base operating system is up to date.

The roles/stack-install/defaults/main.yml file requires the following content to achieve this. First, we have the locations for the RPM packages that enable EPEL and IUS:

repo_packages:  - "epel-release"  - "https://centos7.iuscommunity.org/ius-release.rpm"

After that, we have the following nested variable, which contains all of the information we need to use the yum_repository module in order to create a .repo file for the NGINX repository:

nginx_repo:  name: "nginx" description: ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.