dyanamic ec2 instance

hi,

i want to launch ec2 instance and automate the install jenkins on that instance through playbook.

i tried but it throws the exception,when ever we launch instance dynamic ip is generated,how do we give host name,task is launch instance and when ever instance is laaunched i want jenkins on that instance through one playbook.

thanks.

So you probably want to do this in two plays in a playbook
first play targetting localhost and create the ec2 instance with ec2 module
then use the add_host module to add the ip address that was created into a group

2nd play targetting the new group with the ip address of the ec2 you created in the first play and install jenkins

An example is shown at
http://docs.catalystcloud.io/tutorials/ansible-create-x-servers-using-in-memory-inventory.html

Tony Chia