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.




On Mon, Nov 3, 2014 at 1:13 PM, Florian Dambrine <[email protected]> wrote:

> 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:
>
> -----------------------------------------------------------------------
> *playbook.yaml*
> ---
> - hosts: all
>   sudo: yes
>
>   roles:
>     - { role: icinga, tags: ['icinga'], *reload: false* }
>     - { role: icinga, tags: ['icinga-reload'], *reload: true* }
>
> -----------------------------------------------------------------------
> *meta/main.yaml*
> ---
>   dependencies:
>     - { role: baseline, *when: not reload* }
>
>
> Thanks,
>
> Florian
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/450d7b54-dbb4-448a-b292-37212a2c5e81%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/450d7b54-dbb4-448a-b292-37212a2c5e81%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxGQNw1r0Rz_ctSA3bwW_E2FDt-WMzk%3DEOu8ymUSy%2BXkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to