using ansible on aws, then get the IP address of the aws instances.

592 views
Skip to first unread message

John Smith

unread,
Oct 13, 2016, 11:10:44 AM10/13/16
to Ansible Project
I have an ansible playbook that starts up some aws instances.  once they are up I can see the instances have
public ip and private ip.  

is there a way I can programmatically get the ip addresses from outside aws cliud instead of of having to look at the aws console ?

I want my application (teamcity, run on linux) outside of aws to call the ansible playbook, start up the instances, then when
they are up I need a way to go get the ip addresses of the instances that have been brought up in aws.

has anyone done anything like this ? 

Allen Sanabria

unread,
Oct 13, 2016, 11:14:04 AM10/13/16
to ansible...@googlegroups.com
It depends on how you want to approach this.

1st approach: You can use the ec2.py inventory generator.
2nd approach: You can write Ansible Filters to get inventory dynamically during the same playbook run. Here is an example of Filter that I have written for AWS.

--
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+unsubscribe@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/3d48dc95-0e7a-4075-adcc-a9fe9c50134e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages