# AWS ELB IP grep and update the inventory for the respective domain

**URL:** <https://forum.ansible.com/t/aws-elb-ip-grep-and-update-the-inventory-for-the-respective-domain/26322>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [December 18, 2017, 6:31pm UTC](https://forum.ansible.com/t/aws-elb-ip-grep-and-update-the-inventory-for-the-respective-domain/26322 "2017-12-18T18:31:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DHAVAL\_JAISWAL](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@DHAVAL\_JAISWAL](https://forum.ansible.com/u/DHAVAL_JAISWAL)\
**Post date:** [December 18, 2017, 6:31pm UTC](https://forum.ansible.com/t/aws-elb-ip-grep-and-update-the-inventory-for-the-respective-domain/26322/1 "2017-12-18T18:31:05Z")

</div>

I am trying to grep the IP available on the AWS ELB (nodes attached to it) and then doing some operation on it.

Now, the issue is how can I on the fly update the ansible inventory of the new available IP, so that next operation will read the IP from the inventory and will further execute the next step.

Moreover, I have multiple domains registered in ansible inventory.

E.g. In inventory file I have [abc.com](http://abc.com) & [xyz.com](http://xyz.com) and the IP which grep from the respective ELB should update the only respective domain.

or any other way round if you could advise.
