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

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]#

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 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.

# 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

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.

https://www.mindbowser.com/how-to-create-ec2-instances-using-ansible/

please jump on the above link

Please post the entire playbook, and how you invoke it