Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible aws_ec2 inventory plugin issue

I am trying to get started using Ansible and the aws_ec2 plugin.

I have the following in my ./ansible.cfg file:

[inventory]
enable_plugins = aws_ec2

and the following in my ./inventory.yml file:

plugin: aws_ec2
aws_access_key_id: **********
aws_secret_access_key: **********
regions:
    - us-east-2

when I run ansible-inventory -i inventory.yml --graph I get the following error:

inventory.yml did not meet aws_ec2 requirements, check plugin documentation if this is unexpected

like image 738
Shawn Northrop Avatar asked Feb 06 '19 22:02

Shawn Northrop


1 Answers

As of Ansible 2.7.6:

aws_ec2 inventory filename must end with 'aws_ec2.yml' or 'aws_ec2.yaml'

proof.

So rename your inventory.yml into inventory_aws_ec2.yml and you are good to go.

like image 68
Konstantin Suvorov Avatar answered Sep 21 '22 13:09

Konstantin Suvorov