Better late than never
- hosts: localhost
tasks:
- add_host:
name: "{{ item }}"
groups: elected_leader
with_random_choice: "{{ groups['web'] }}"
- hosts: elected_leader
gather_facts: no
tasks:
- debug: var=inventory_hostname
--
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/069f6b23-ae81-4817-8d35-9c13d02c831e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.