Ansible FAQ clarifies
"‘inventory_hostname’ is a magic variable that indicates the current host
you are looping over in the host loop."
Is there a similar concept of *inventory_groupname* that can be made
available to be used inside a playbook ?
e.g. If we are running a playbook in this manner
ansible-playbook -i inventory/prod site.yml --limit service_a
And 'prod' inventory is defined as below
[service_a]
host1
host2
[service_b]
host2
host3
Then is it feasible to reference the group name - service_a - inside
site.yml in this manner - {{ inventory_groupname }}
--
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/788e83bd-9c36-4e01-862b-5b5de43f6f3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.