> 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.
>
> 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.
--
Brian Coca