Automation of network services using Ansible
Automating the setup of interfaces can be as simple or complex as you want to make it. Our recommendation is to start with installing the ansible galaxy system roles known as Red Hat Enterprise Linux (RHEL) system roles since we are using RHEL and not just any Linux. This can be accomplished by checking to see whether they are installed by ansible-galaxy first using the following command:
[emcleroy@rhel3 ~]$ ansible-galaxy list # /usr/share/ansible/roles # /etc/ansible/roles
This confirms that the network role is missing. Running the following command installs the roles:
[emcleroy@rhel3 ~]$ sudo dnf install rhel-system-roles
As you can see from this screenshot, the roles are now installed by running the $ ansible-galaxy
list
command:
Figure 3.13 – Screen seen after installing the system roles
You can get explanations on the different system roles or examples in the following location: /usr...