# Is it possible to exclude a role in meta/main.yaml ?

**URL:** <https://forum.ansible.com/t/is-it-possible-to-exclude-a-role-in-meta-main-yaml/16672>\
**Category:** Ansible Project\
**Created:** [November 3, 2014, 6:13pm UTC](https://forum.ansible.com/t/is-it-possible-to-exclude-a-role-in-meta-main-yaml/16672 "2014-11-03T18:13:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florian\_Dambrine](https://avatars.discourse-cdn.com/v4/letter/f/f17d59/32.png) [@Florian\_Dambrine](https://forum.ansible.com/u/Florian_Dambrine)\
**Post date:** [November 3, 2014, 6:13pm UTC](https://forum.ansible.com/t/is-it-possible-to-exclude-a-role-in-meta-main-yaml/16672/1 "2014-11-03T18:13:19Z")

</div>

Hi guys,

I am trying to exclude a role in the meta/main.yaml according to a var that is defined in my main playbook. Is it possible to do it?

Here is what I would like to do:

---

<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:** [November 3, 2014, 11:11pm UTC](https://forum.ansible.com/t/is-it-possible-to-exclude-a-role-in-meta-main-yaml/16672/2 "2014-11-03T23:11:47Z")

</div>

I’m not sure of whether there are any quirks with dependencies with “when:” conditions, but this should be an easy experiment to see if it works or not.

Alternatively you could do a main.yml for ‘baseline’ that adds the “when” to a task include.
