0

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 10.101.44.73,10.101.42.73,10.101.16.73 so parameter file look like below:

Interfaces:
  - {Name: "eth0", IP: "10.101.44.73", Prefix: 23}
  - {Name: "eth1", IP: "10.101.42.73", Prefix: 23}
  - {Name: "eth2", IP: "10.101.16.73", 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.