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

53 views
Skip to first unread message

Florian Dambrine

unread,
Nov 3, 2014, 1:13:19 PM11/3/14
to ansible...@googlegroups.com
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

Michael DeHaan

unread,
Nov 3, 2014, 6:11:50 PM11/3/14
to ansible...@googlegroups.com
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.




--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/450d7b54-dbb4-448a-b292-37212a2c5e81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages