On Wednesday, 24 December 2014 19:32:11 UTC+5:30, Brian Coca wrote: > > > I was under the impression that groups was at the "current playbook" > scope, > > as its available for new plays in the same playbook (operating on > different > > hosts pattern). > > > groups is available to every play but only once hosts/inventory is > loaded, which is not the case with the - hosts: directive. >
Ok, if I could pass the pattern to the included play, I can use it directly in the hosts pattern. But I'm not able to pass that. > > > > > The reason I have the ternary condition is I'm unable to pass the new > host > > pattern to "cli_hosts", if I could do that, than the pattern expression > will > > be simpler. Is there a way I can do that? that is pass the host pattern > via > > include. > > > I don't understand, if you are passing cli_hosts in the command line > it should be easy enough to pass a pattern -e > 'cli_hosts=group1:!group2'. > > As for the play needing to target new_hosts, just leave it at that, if > there are no new_hosts ti should be skipped. > That is exactly what I was using in fact. But now there is a new requirement of having a default cluster if none of them are defined, that is cli_cluster or new_hosts. and, that is why I started working with the defaults filter to come up with an expression to solve this. -- Raghu > > -- > Brian Coca > -- 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/4cc8c3b2-90e9-4ac6-8e79-7a23da13c491%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
