This worked.

[..snip..]

  tasks:

   - debug:  msg="The system {{ inventory_hostname }} will now be upgraded."
   - debug:  msg="The value of play_hosts is {{ play_hosts }}."

# This ensures that we dont proceed unless we're really only acting on a 
single host, for sure!
# Another option would be to refactor this playbook to accept a 
hostname/string as a target
# Another option would be to pass in --limit 'somehost' when running the 
playbook
   - assert: { that: "play_hosts | length == 1" }
#   - debug: msg="The variable play_hosts is length of 1, which means that 
only a single host will be upgraded at a time, proceeding with upgrade to 
{{ inventory_hostname }}"

[..snip..]

Thanks for the idea!

Lucky

-- 
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/6eb7282d-0850-4dc8-99ae-1d320b930b8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to