You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Not sure if this has been asked before, but I needed to include some playbooks conditionally, each of these was a top level that ran on different hosts:
- include: play1.yml when: "'var1 in some_list"
- include: play2.yml when: "'var2' in some_list"
But apparently this doesn't work, no errors are generated, but the playbooks are always inlcuded and run even when the condition is false. So I took my conditions to another level inside and applied them to roles:
But this results in a whole lot of skipped output in the run. There must a cleaner way to do this?
Thanks
Brian Coca
unread,
Jun 10, 2015, 9:21:15 PM6/10/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
The only conditional applicable to a play, is the hosts: selection.
Iincludes, roles and everything else won't get conditions applied, but
they can pass them on to the only object that is subject to
conditions, the tasks.
this changes a bit in v2 but that is still in development.
--
Brian Coca
Javeria Khan
unread,
Jun 10, 2015, 10:36:46 PM6/10/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
'Hosts' has to have a group name infront of it right? To be able to apply the condition, could I conditionally include the relevant hosts to that group?
Brian Coca
unread,
Jun 10, 2015, 10:47:44 PM6/10/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
possibly, but the variables you have available in that scope is small.