Ansible aws_ec2广告资源插件问题

Sha*_*rop 2 amazon-ec2 ansible ansible-inventory

我正在尝试开始使用Ansible和aws_ec2插件。

我的./ansible.cfg文件中包含以下内容:

[inventory]
enable_plugins = aws_ec2
Run Code Online (Sandbox Code Playgroud)

以及我./inventory.yml文件中的以下内容:

plugin: aws_ec2
aws_access_key_id: **********
aws_secret_access_key: **********
regions:
    - us-east-2
Run Code Online (Sandbox Code Playgroud)

当我运行时ansible-inventory -i inventory.yml --graph,出现以下错误:

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

Kon*_*rov 5

从Ansible 2.7.6开始:

aws_ec2广告资源文件名必须以'aws_ec2.yml'或'aws_ec2.yaml'结尾

证明

因此,重命名inventory.ymlinventory_aws_ec2.yml,你是好去。

  • 我希望调试信息显示此错误。我在使用 `-vvvv` 时看到的是:`/app/aws_ec2.yml 不符合 host_list 要求,如果这是意外,请检查插件文档` (2认同)