# include: myplaybook.yml tags=mytag, how to make it work ?

**URL:** <https://forum.ansible.com/t/include-myplaybook-yml-tags-mytag-how-to-make-it-work/16542>\
**Category:** Ansible Project\
**Created:** [October 17, 2014, 6:24pm UTC](https://forum.ansible.com/t/include-myplaybook-yml-tags-mytag-how-to-make-it-work/16542 "2014-10-17T18:24:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alain\_Kreienbuhl](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Alain\_Kreienbuhl](https://forum.ansible.com/u/Alain_Kreienbuhl)\
**Post date:** [October 17, 2014, 6:24pm UTC](https://forum.ansible.com/t/include-myplaybook-yml-tags-mytag-how-to-make-it-work/16542/1 "2014-10-17T18:24:59Z")

</div>

Hello,

Including a playbook with a tag restriction doesn’t actually restrict the playbook to the tags. It play’s the whole playbook.

am I missing something ?

Thanks

Alain

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 20, 2014, 9:06pm UTC](https://forum.ansible.com/t/include-myplaybook-yml-tags-mytag-how-to-make-it-work/16542/2 "2014-10-20T21:06:13Z")

</div>

There are no tag restrictions this way, what you have done, which is consistent with how this is documented, is tagged the tasks with those plays.

---

<div class="post-metadata">

**Author:** ![Alain\_Kreienbuhl](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Alain\_Kreienbuhl](https://forum.ansible.com/u/Alain_Kreienbuhl)\
**Post date:** [October 24, 2014, 6:18pm UTC](https://forum.ansible.com/t/include-myplaybook-yml-tags-mytag-how-to-make-it-work/16542/3 "2014-10-24T18:18:04Z")

</div>

Okay, I did miss the semantic here. I’d thought it was include “only” the task associated with the tags given. Which incidentally was exactly what I was looking for.  
The only was to do that ( restrict by tag ) is only on the command line with -t option right ?

Thanks

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 25, 2014, 12:04am UTC](https://forum.ansible.com/t/include-myplaybook-yml-tags-mytag-how-to-make-it-work/16542/4 "2014-10-25T00:04:13Z")

</div>

“The only was to do that ( restrict by tag ) is only on the command line with -t option right ?”

yep!
