In order to use Ansible, we first need to define the inventory, which represents the available resources. Then, we will be able to either execute a single command or define a set of tasks using the Ansible playbook.
Using Ansible
Creating an inventory
An inventory is a list of all the servers that are managed by Ansible. Each server requires nothing more than the Python interpreter and the SSH server installed. By default, Ansible assumes that the SSH keys are used for authentication; however, it is also possible to use the username and the password, by adding the --ask-pass option to the Ansible commands.
SSH keys can be generated with the ssh-keygen tool, and they are usually stored in the ~/.ssh directory.
The inventory...