Skip to content

Latest commit

 

History

History
54 lines (27 loc) · 1.85 KB

README.md

File metadata and controls

54 lines (27 loc) · 1.85 KB

Ansible

Automation_Ansible_Playbook

We have written Ansible YAML file to create an EC2 instance

ec2_create

Before Running the YAML file, need to be check syntax

ansible-playbook ec2_instance.yml --syntax-check

syntax

if you are not getting any error, we are good to run the ansible-playbook

After running, We are getting below error. It says, boto needs to be installed.

boto_error

So we need to run the below command to install boto

sudo yum install -y python-pip

once installed pip,then run the below command to install boto & boto 3 version

sudo pip install boto boto3

after everything installed, again we're facing issue. It says #### "Handlers were checked" which means

handler

we need to provide Credentials details. Either you can add into YAML file or run like below

export AWS_ACCESS_KEY="aws access key generated from AWS"

export AWS_SECRET_ACCESS_KEY=" aws secret key generated from AWS"

once everything added, run the below command

ansible-playbook ec2_instance.yml

Now we have successfully launched

created_ec2

Before Run Ansible script

before

After Run Ansible Script

after