Doesn't matter, I've used add_host and then called the group using hosts 
instead and I'll just delegate back down to the localhost to perform the 
actions I need it to instead.

Karen

On Thursday, October 29, 2015 at 11:37:47 AM UTC+10, K Cheng wrote:
>
> Hey guys,
>
> Just wondering whether there is a way to access the contents of a add_host 
> group?
>
> EG:
>
> - name: Add newly created instance to host group created_instances
>   add_host: 
>     hostname: "{{ item.private_ip }}"
>     testvar: test_variable
>
>     public_one: "{{ item.public_ip }}" 
>
>     groups: created_instances
>   with_items: "{{ ec2.instances | default({}) }}"
>
>
>
>           - name: Get specific data from newly created instances
>
>  debug: var="{{ item.testvar }}
>
>  with_items: created_instances 
>
>
>
> At the moment, when I do the above, item is only the IP address (private 
> ip address) and I can't seem to get at anything specific. I'm using dynamic 
> inventory and I was hoping not to have to rerun the dynamic inventory again 
> seeing as I thought add_host was supposed to add details to in-memory 
> groups.
>
> Regards
>
> Karen 
>

-- 
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+unsubscr...@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/1a868fdc-dcb7-436f-8582-800a9d678b39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to