July 2017
Intermediate to advanced
266 pages
6h 36m
English
One of the most effective ways to modularize and organize an Ansible playbook is to use Ansible include. Ansible play includes provide an easy way to embed play from other YAML files. This implementation allows us to effectively modularize our playbook's automation. Let's take a look at how to leverage a play include within an Ansible playbook:
# This is an example of a 'play' include, which includes the contents of playlevelplays.yml- include: playlevelplays.yml- name: some play hosts: all tasks: - debug: msg=hello# This is an example of the contents of playlevelplays.yml- name: some additional play hosts: all tasks: - debug: msg=hello I am an included file
In this example, we can see that to implement a play include, ...
Read now
Unlock full access