EC2 provisioning with Ansible

Is it possible to fully automatic launch an EC2 instance and run the playbooks against this instance, with only one command?

Currently when I run the playbook, I need to assume this EC2 instance is already in my host file, it would be great if they can be done fully automatically.

You might need to use the Vagrant to boot the EC2 instance with Ansible performing the provisioning step.

Bryan

Yes, you can, using ‘register’ and ‘groupname’.

Take a look at this playbook I did to do just that: https://github.com/phips/aws-jenkins

Is it possible to fully automatic launch an EC2 instance and run the playbooks against this instance, with only one command?

There’s a good example of this in the Ansible documentation here: http://docs.ansible.com/guide_aws.html#provisioning

Also: http://docs.ansible.com/guide_aws.html#example-4