Ansible is an open-source software provisioning, configuration management, and application-deployment tool enabling infrastructure as code. It runs on many Unix-like systems, and can configure both Unix-like systems as well as Microsoft Windows. It includes its own declarative language to describe system configuration. Ansible was written by Michael DeHaan and acquired by Red Hat in 2015. Ansible is agentless, temporarily connecting remotely via SSH or Windows Remote Management (allowing remote PowerShell execution) to do its tasks.
1 Install ansible
Ansible is available in the EPEL repository of CentOS 8. So, you can easily install Ansible on CentOS 8. To enable EPEL repository, install the epel-release package with the following command:
sudo dnf install epel-release
Now install Ansibel by running the following command:
sudo dnf install ansible
Check that Ansible is successfully installed by using this command:
In this section we are going to configure the Ansible.
First we are going to create a user ansible that will contain all the Playbooks and the configuration of the ansible in the home directory.
Set a strong password for the new user:
Now, create an Ansible inventory file as follows: