June 2017
Intermediate to advanced
446 pages
10h 10m
English
As the playbook grows in size, it will eventually become obvious that many of the tasks and playbooks can be shared across different playbooks. The Ansible include statement is similar to many Linux configuration files that just tell the machine to extend the file the same way as if the file was directly written in. We can do an include statement for both playbooks and tasks. We will look at a simple example for extending our tasks.
Let's assume that we want to show outputs for two different playbooks. We can make a separate YAML file called show_output.yml as an additional task:
--- - name: show output debug: var: output
Then, we can reuse this task in multiple playbooks, such as in chapter5_11_1.yml that looked ...
Read now
Unlock full access