The Ansible architecture
The Ansible architecture consists of playbooks, plays, and tasks. Take a look at df_playbook.yml
, which we used previously:
Figure 4: An Ansible playbook
The whole file is called a playbook, which contains one or more plays. Each play can consist of one or more tasks. In our simple example, we only have one play, which contains a single task. In this section, we will take a look at the following components and terms related to Ansible, some of which we have already seen:
- YAML: This format is extensively used in Ansible to express playbooks and variables.
- Inventory: The inventory is where you can specify and group hosts in your infrastructure. You can also optionally specify host and group variables in the inventory file.
- Variables: Each network device is different. It has a different hostname, IP, neighbor relations, and so on. Variables allow for a standard set of plays while still accommodating these differences.
- Templates: Templates...