# fatal: \[localhost\]: FAILED! =\> {"changed": false, "msg": "Instance creation failed

**URL:** <https://forum.ansible.com/t/fatal-localhost-failed-changed-false-msg-instance-creation-failed/33233>\
**Category:** Ansible Project\
**Created:** [June 23, 2020, 10:07am UTC](https://forum.ansible.com/t/fatal-localhost-failed-changed-false-msg-instance-creation-failed/33233 "2020-06-23T10:07:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mujeeb\_k.s](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@Mujeeb\_k.s](https://forum.ansible.com/u/Mujeeb_k.s)\
**Post date:** [June 23, 2020, 10:07am UTC](https://forum.ansible.com/t/fatal-localhost-failed-changed-false-msg-instance-creation-failed/33233/1 "2020-06-23T10:07:00Z")

</div>

Hi

I am trying to create EC2 in using play book, but i am unable to create instance  
I am getting below error

Please help me, how can i fix this issue

[root@jenkinansible ansible]# ansible-playbook ec2.yml

PLAY [creating ec2 instance] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [creating ec2 instance] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [localhost]: FAILED! =\> {“changed”: false, “msg”: “Instance creation failed =\> Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.”}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

[root@jenkinansible ansible]#

---

<div class="post-metadata">

**Author:** ![Avinash\_Jadhav](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Avinash\_Jadhav](https://forum.ansible.com/u/Avinash_Jadhav)\
**Post date:** [June 23, 2020, 10:11am UTC](https://forum.ansible.com/t/fatal-localhost-failed-changed-false-msg-instance-creation-failed/33233/2 "2020-06-23T10:11:12Z")

</div>

Hi Mujeeb,  
Please follow the below step

Once you are done with the AWS account and the User creation, you can move forward and install the required things.

1. Ansible:
  1. Install Ansible on a RHEL/CentOS Linux based system
    1. _$ sudo yum install Ansible_

  2. Install Ansible on a Debian/Ubuntu Linux based system
    1. _$ sudo apt-get install software-properties-common_
    2. _$ sudo apt-add-repository ppa:Ansible/Ansible_
    3. _$ sudo apt-get update_
    4. _$ sudo apt-get install Ansible_

  3. Install Ansible using pip
    1. _$ sudo pip install Ansible_
    2. _Once installed you can verify by Ansible –version this command._

2. Python:
  1. $ sudo apt-get update
  2. $ sudo apt-get install python3.6
  3. You can follow this [link](https://docs.python-guide.org/starting/install3/linux/) for more details.

3. Boto: (Boto is a Python package which provides an interface to AWS.)
  1. First, install pip
    1. _$ sudo apt install python3-pip or_
    2. _$ yum install python-pip_

  2. Now install boto
    1. _$ pip install boto_

Now, we are done with the package installation, we can move ahead and start writing our Ansible playbook.

Note: There are multiple ways you can install the above packages. I have added the ones that I followed but you can install as per your knowledge.

Now open a terminal and create a file with the extension .yml or .ymal, add below script and save it.

```auto
# Basic provisioning example
- name: Ansible test
hosts: localhost
tasks:
- name: launching AWS instance using Ansible
ec2:
key_name: aws_instance_Ansible
instance_type: t2.micro
image: ami-0dacb0c129b49f529
region: us-east-2
wait: yes
group: Ansible
count: 1
vpc_subnet_id: default
assign_public_ip: yes
aws_access_key: *********** xxxxxxxx
Aws_secret_key: *********** xxxxxxxx

```

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [June 23, 2020, 10:16am UTC](https://forum.ansible.com/t/fatal-localhost-failed-changed-false-msg-instance-creation-failed/33233/3 "2020-06-23T10:16:19Z")

</div>

Hi Avinash,

Mujeeb already tried these things. Error is due to ARM AMI not running on any region. I don’t have an account to test this. Can you please help?

Mujeeb, please specify all details like AMI and region details and console log.

---

<div class="post-metadata">

**Author:** ![Avinash\_Jadhav](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Avinash\_Jadhav](https://forum.ansible.com/u/Avinash_Jadhav)\
**Post date:** [June 23, 2020, 10:30am UTC](https://forum.ansible.com/t/fatal-localhost-failed-changed-false-msg-instance-creation-failed/33233/4 "2020-06-23T10:30:06Z")

</div>

[https://www.mindbowser.com/how-to-create-ec2-instances-using-ansible/](https://www.mindbowser.com/how-to-create-ec2-instances-using-ansible/)

please jump on the above link

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [June 25, 2020, 2:57am UTC](https://forum.ansible.com/t/fatal-localhost-failed-changed-false-msg-instance-creation-failed/33233/5 "2020-06-25T02:57:27Z")

</div>

Please post the entire playbook, and how you invoke it
