Identifying manual tasks to be automated
In the previous chapter, you learned how to use Ansible ad hoc commands to manually execute tasks on remotely managed nodes using Ansible modules. Now, you will learn how to start with simple Ansible playbooks and tasks. Remember, you need to add your managed node details to your inventory file before you can execute any Ansible tasks.
We will start with a simple automation job to understand the basics of the Ansible playbook. For this example, we are assuming you have installed and configured the chronyd
application. The chrony
application is an implementation of the Network Time Protocol (NTP). chronyd
is the default NTP client and server in Red Hat Enterprise Linux 8 and SUSE Linux Enterprise Server 15 and is available in many Linux distributions.
For our example Ansible playbook, we will do the following:
- Install the
chrony
package on all nodes. - Adjust the
chrony
configurations. - Start the
chronyd
service and enable...