Including playbooks
Playbook files can include other whole playbook files. This construct can be useful to tie together a few independent playbooks into a larger, more comprehensive playbook. Playbook inclusion is a bit more primitive than task inclusion. You cannot perform variable substitution when including a playbook, you cannot apply conditionals, and you cannot apply tags, either. The playbook files to be included must exist at the time of execution as well.
Prior to Ansible 2.4, playbook inclusion was achieved using the include keyword—however, this is deprecated and will be removed in Ansible 2.8, and so it should not be used. Instead, you should now use import_playbook. This is a play-level directive—it cannot be used as a task. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access