I think you could leverage the play_hosts var which contains the list of the
hosts involved in the current play by asserting that its length is equal to 1
(a play start with hosts and tasks declaration, that is at the same level where
you set the serial attr).
Bye,
luca
PS: a little utility to dump ansible variables (Unfortunately I can't remember
where I copied it from so I can't credit the author)
- template: src=debug_all_vars.j2 dest=/tmp/ansible.all.vars.debug
debug_all_vars.j2:
Module Variables ("vars"):
--------------------------------
{{ vars | to_nice_json }}
Environment Variables ("environment"):
--------------------------------
{{ environment | to_nice_json }}
GROUP NAMES Variables ("group_names"):
--------------------------------
{{ group_names | to_nice_json }}
GROUPS Variables ("groups"):
--------------------------------
{{ groups | to_nice_json }}
Luca
----- Original Message -----
> From: "Brian Coca" <[email protected]>
> To: [email protected]
> Sent: Tuesday, November 18, 2014 8:52:31 PM
> Subject: Re: [ansible-project] Re: Method for checking the value of "serial"
> well, the only place you can set serial is on the play, that alone should
> ensure it.
> but for the paranoid, you can use the play_hosts variable to either check if
> it is a list lenght of 1 or that the only item inside it is
> inventory_hostname.
> --
> 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/CAJ5XC8nfMyAV32LSbT%3DPO3u87iyPNAykfmejp7MsOreVUVysyg%40mail.gmail.com
> .
> 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/738773132.191067.1416343616708.JavaMail.root%40dbmsrl.com.
For more options, visit https://groups.google.com/d/optout.