I am using Dynamic inventory to get the latest Ec2 IP addresses.

I have parameter files under host_vars folder. Each parameter file will have placements for ENI's attached to a particular EC2 machine.

for Ex: EC2 machine name is as1nsp13 and 3 ENi's attached to this machine with ip addresses of,, so parameter file look like below:

  - {Name: "eth0", IP: "", Prefix: 23}
  - {Name: "eth1", IP: "", Prefix: 23}
  - {Name: "eth2", IP: "", Prefix: 20}

My Question is how do i get these 3 ENI IP's and update the parameter file with latest ENI ip's? Is that possible using dynamic inventory concept? or do i need to se AWS CLI and some shell script to update the parameter file?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.