Skip to content

sudeer13/Ansible-AWS-Dynamic-Inventory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Setting Up Ansible AWS EC2 Dynamic Inventory

Pre-requisites:

  1. Install and setup Ansible Server
  2. Install boto (version>=2.24.0)
  3. IAM Programmatic access user in AWS with EC2 access.
  4. Get the ec2.ini and ec2.py file.

Setup

To get help on dynamic inventory please follow Ansible Official Document

  1. Create IAM Programmatic access user with EC2 full access on AWS console

    IAM --> users --> Add user

  2. Export IAM user credentials on Ansible server.

    export AWS_ACCESS_KEY_ID='XXXXX'
    export AWS_SECRET_ACCESS_KEY='XXXXX'
  3. To export keys permanently make sure that you have installed pip and boto and add credentials ~/.boto file

  4. add executing permissions to ec2.py script

    chmod 755 ec2.py
  5. test the script

    ./ec2.py --list
    
  6. List out servers which are running on ap-south-1a AZ

    ansible -i ec2.py  ap-south-1a --list-hosts
    

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages