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.
Ansible:
Install Ansible on a RHEL/CentOS Linux based system
$ sudo yum install Ansible
Install Ansible on a Debian/Ubuntu Linux based system
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:Ansible/Ansible
$ sudo apt-get update
$ sudo apt-get install Ansible
Install Ansible using pip
$ sudo pip install Ansible
Once installed you can verify by Ansible –version this command.
Python:
$ sudo apt-get update
$ sudo apt-get install python3.6
You can follow this link for more details.
Boto: (Boto is a Python package which provides an interface to AWS.)
First, install pip
$ sudo apt install python3-pip or
$ yum install python-pip
Now install boto
$ 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
Akasurde
(Abhijeet Kasurde)
June 23, 2020, 10:16am
3
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.
Please post the entire playbook, and how you invoke it