group name from variable

18 views
Skip to first unread message

francesco...@develon.com

unread,
Oct 9, 2015, 12:16:20 PM10/9/15
to Ansible Project
Hi!
I would like to run a role something like

- name: debug role
  debug: msg="{{ hostvars[item].ansible_host }}"
  with_items: groups[ {{ALLOWED_HOSTS_GROUP}} ]

however the syntax groups[ {{ALLOWED_HOSTS_GROUP}} ] is not accepted.
Is there any other way to pass a group name from a variable defined e.g. in a playbook?

Thanks for your support.

Brian Coca

unread,
Oct 9, 2015, 1:04:34 PM10/9/15
to Ansible Project
with_items: "{{ groups[ALLOWED_HOSTS_GROUP] }}"



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages