# EC2 provisioning with Ansible

**URL:** <https://forum.ansible.com/t/ec2-provisioning-with-ansible/14331>\
**Category:** Ansible Project\
**Created:** [January 13, 2014, 3:32pm UTC](https://forum.ansible.com/t/ec2-provisioning-with-ansible/14331 "2014-01-13T15:32:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![howachen](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@howachen](https://forum.ansible.com/u/howachen)\
**Post date:** [January 13, 2014, 3:32pm UTC](https://forum.ansible.com/t/ec2-provisioning-with-ansible/14331/1 "2014-01-13T15:32:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bryan\_hunt1](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bryan\_hunt1](https://forum.ansible.com/u/bryan_hunt1)\
**Post date:** [January 13, 2014, 5:23pm UTC](https://forum.ansible.com/t/ec2-provisioning-with-ansible/14331/2 "2014-01-13T17:23:14Z")

</div>

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

Bryan

---

<div class="post-metadata">

**Author:** ![Mark\_Phillips](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mark\_Phillips](https://forum.ansible.com/u/Mark_Phillips)\
**Post date:** [January 13, 2014, 5:33pm UTC](https://forum.ansible.com/t/ec2-provisioning-with-ansible/14331/3 "2014-01-13T17:33:20Z")

</div>

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](https://github.com/phips/aws-jenkins)

---

<div class="post-metadata">

**Author:** ![Joshua\_Conner](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@Joshua\_Conner](https://forum.ansible.com/u/Joshua_Conner)\
**Post date:** [January 13, 2014, 7:06pm UTC](https://forum.ansible.com/t/ec2-provisioning-with-ansible/14331/4 "2014-01-13T19:06:46Z")

</div>

> 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](http://docs.ansible.com/guide_aws.html#provisioning)

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [January 13, 2014, 10:35pm UTC](https://forum.ansible.com/t/ec2-provisioning-with-ansible/14331/5 "2014-01-13T22:35:04Z")

</div>

Also: [http://docs.ansible.com/guide\_aws.html#example-4](http://docs.ansible.com/guide_aws.html#example-4)
