Ah, I should have mentioned that in my playbook I have a hosts line like:

hosts: group1,group2,group3

... and then I limit by this custom group I mentioned (which may be empty
or not exist at all). That's when the playbook fails... when the --limit
doesn't match any host at all.

You did, however, give me an idea. By making my hosts like something like:

hosts: group1,group2,group3,&{{ required | default('all') }}

... I can provide the custom group as an extra variable and it works as I
need it to. Thanks for replying!

- Gonz

On Mon, Oct 29, 2018 at 4:52 PM Vladimir Botka <[email protected]> wrote:

>
>> Running the playbook below with an empty group results in 0 exit code.
> What am I missing?
>
>     - hosts: test99
>       pre_tasks:
>         - debug: var=play_hosts
>           delegate_to: localhost
>
> HTH,
>
> -vlado
>
> --
> 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/387275ce-ab1d-447d-89b2-48b8803be77f%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/387275ce-ab1d-447d-89b2-48b8803be77f%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/CAHpidMABRKsfPio6Gd9CxLKVwepfd8usPhMUrYsuyfb3s78n9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to