# Importing multiple ansible playbooks

**URL:** <https://forum.ansible.com/t/importing-multiple-ansible-playbooks/37294>\
**Category:** Ansible Project\
**Created:** [November 2, 2022, 4:22pm UTC](https://forum.ansible.com/t/importing-multiple-ansible-playbooks/37294 "2022-11-02T16:22:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Bidwell](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@Chris\_Bidwell](https://forum.ansible.com/u/Chris_Bidwell)\
**Post date:** [November 2, 2022, 4:22pm UTC](https://forum.ansible.com/t/importing-multiple-ansible-playbooks/37294/1 "2022-11-02T16:22:23Z")

</div>

Hi all,

Is there a way, or what is the syntax since I can’t seem to find it on importing an ansible playbook and with that applying a specific tag to one or some of those playbooks?

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [November 2, 2022, 5:16pm UTC](https://forum.ansible.com/t/importing-multiple-ansible-playbooks/37294/2 "2022-11-02T17:16:34Z")

</div>

First you should read these pages that describe the difference between import vs include.

[https://docs.ansible.com/ansible/2.9/user\_guide/playbooks\_reuse\_includes.html](https://docs.ansible.com/ansible/2.9/user_guide/playbooks_reuse_includes.html)

[https://docs.ansible.com/ansible/2.9/user\_guide/playbooks\_reuse.html#tradeoffs-and-pitfalls-between-includes-and-imports](https://docs.ansible.com/ansible/2.9/user_guide/playbooks_reuse.html#tradeoffs-and-pitfalls-between-includes-and-imports)

Do you want to import these playbooks and parse them once at load time, or “include” and parse them as they are encountered at run-time?

One reason to consider include vs import. If you have a when clause on an imported playbook, all the tasks within the playbook inherit that when clause and are evaluated individually. If you have a when clause on an included playbook, it applies to the include task itself (whether I include and execute the playbook). This can be a huge performance improvement.

Secondly you want to consider whether you want to include “playbooks” or “tasks” files. Task files inherit the inventory, become, gather\_facts, etc of the parent playbook that includes them.

Walter
