Ansible Dynamic Inventory For AWS Resources

0 68
  1. Make sure you have Ansible on Amazon Linux 2 AMI, here the reference link
  2. Install PIP using:
    sudo pip install boto -y
  3. Make sure you have IAM role created with EC2fullAccess policy and attached to your ansible EC2 instance
  4. Download these file
    2. EC2.ini
  5. Add executing permissions to script
    chmod 755
  6. Test the script
    ./ --list
  7. List out servers which are running on us-east-1 region:
    ansible -i us-east-1 --list-hosts
  8. Similarly, you can get details based on EC2 tags

Leave A Reply

Your email address will not be published.