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

42 views
Skip to first unread message

Mujeeb k.s

unread,
Jun 23, 2020, 6:07:01 AM6/23/20
to Ansible Project
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]#

Avinash Jadhav

unread,
Jun 23, 2020, 6:11:39 AM6/23/20
to ansible...@googlegroups.com
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

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/509b3dbe-e01c-4a52-833d-65eb0c5dedb8o%40googlegroups.com.

Abhijeet Kasurde

unread,
Jun 23, 2020, 6:16:53 AM6/23/20
to ansible...@googlegroups.com
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.



--
Thanks,
Abhijeet Kasurde

Avinash Jadhav

unread,
Jun 23, 2020, 6:30:33 AM6/23/20
to ansible...@googlegroups.com

Dick Visser

unread,
Jun 24, 2020, 10:57:58 PM6/24/20
to ansible...@googlegroups.com
Please post the entire playbook, and how you invoke it

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/509b3dbe-e01c-4a52-833d-65eb0c5dedb8o%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.
Reply all
Reply to author
Forward
0 new messages