--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/48938ce6-29eb-4333-95f3-fce5c11cf26f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You want:
{{ hostvars[item].inventory_hostname }}
On Sunday, April 17, 2016, Rick O'Shea <cogi...@gmail.com> wrote:
This sort of works:--- hosts: mastertasks:- name loop through slaves and copy template results to mastertemplate: src=template.txt dest={item}.txtwith_items: {{groups.slaves}}What I really want is this but it fails since item "has no attribute 'inventor_hostname'":- hosts: mastertasks:- name loop through slaves and copy template results to mastertemplate: src=template.txt dest={item.inventory_hostname}.txtwith_items: {{groups.slaves}}Assuming that can be made to work, the template.txt also assumes it has access to a host, complete with host variables etc.
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 ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/48938ce6-29eb-4333-95f3-fce5c11cf26f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.