# Need a Playbook to launch an instance

**URL:** <https://forum.ansible.com/t/need-a-playbook-to-launch-an-instance/28000>\
**Category:** Ansible Project\
**Created:** [July 10, 2018, 5:30am UTC](https://forum.ansible.com/t/need-a-playbook-to-launch-an-instance/28000 "2018-07-10T05:30:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Syed\_Jafar](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@Syed\_Jafar](https://forum.ansible.com/u/Syed_Jafar)\
**Post date:** [July 10, 2018, 5:30am UTC](https://forum.ansible.com/t/need-a-playbook-to-launch-an-instance/28000/1 "2018-07-10T05:30:58Z")

</div>

Could anyone share a working Playbook that launches an instance.  
Thanks,  
S. Jafar

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [July 10, 2018, 6:24am UTC](https://forum.ansible.com/t/need-a-playbook-to-launch-an-instance/28000/2 "2018-07-10T06:24:28Z")

</div>

This playbook will create an image with the attributes specified in the variables. The volumes will be the default size(s) from the AMI, the instance will have the default IP addressing, and so on.

# Playbook to launch a basic image

---

<div class="post-metadata">

**Author:** ![Syed\_Jafar](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@Syed\_Jafar](https://forum.ansible.com/u/Syed_Jafar)\
**Post date:** [July 10, 2018, 9:33pm UTC](https://forum.ansible.com/t/need-a-playbook-to-launch-an-instance/28000/3 "2018-07-10T21:33:52Z")

</div>

Here is a playbook I am running to create an EC2 instance and listed below is the error I am getting. Any ideas?

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [July 10, 2018, 11:53pm UTC](https://forum.ansible.com/t/need-a-playbook-to-launch-an-instance/28000/4 "2018-07-10T23:53:14Z")

</div>

Why not try the working, tested sample I sent you?

I suspect the error flows from not having your variables indented correctly, because count is definitely a valid attribute for the ec2 module.

Regards, K.

---

<div class="post-metadata">

**Author:** ![Syed\_Jafar](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@Syed\_Jafar](https://forum.ansible.com/u/Syed_Jafar)\
**Post date:** [July 11, 2018, 5:48pm UTC](https://forum.ansible.com/t/need-a-playbook-to-launch-an-instance/28000/5 "2018-07-11T17:48:15Z")

</div>

Hi Karl,

Just ran you Playbook and got the error listed below.

**ubuntu@ip-10-0-1-14** : **/etc/ansible/Playbooks** $ cat new-2.create.ec2.yml

# Playbook to launch a basic image

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [July 11, 2018, 11:24pm UTC](https://forum.ansible.com/t/need-a-playbook-to-launch-an-instance/28000/6 "2018-07-11T23:24:59Z")

</div>

You will need to install boto3.
