# Coming two lists into one

**URL:** <https://forum.ansible.com/t/coming-two-lists-into-one/19089>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [August 23, 2015, 7:30am UTC](https://forum.ansible.com/t/coming-two-lists-into-one/19089 "2015-08-23T07:30:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stanley\_Nguyen](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@Stanley\_Nguyen](https://forum.ansible.com/u/Stanley_Nguyen)\
**Post date:** [August 23, 2015, 7:30am UTC](https://forum.ansible.com/t/coming-two-lists-into-one/19089/1 "2015-08-23T07:30:05Z")

</div>

I’m having a very simple requirement but I have a tough time to make it work…

Basically I have a list like this:

MACHINES:  
[ { name: “Test1”, ip: “192.168.1.100”},  
{ name: “Test2”, ip: “192.168.1.101”},  
]

I then query AWS to get a list of machines back in a registered variable. What I want to do is to loop over this this registered variable to get InstanceID for any matching host with my MACHINES, then tag it with the Name in MACHINES. Can anyone advise on how I can achieve this?

Thanks,

Stanley
