回答:找不到动态广告资源模块错误

时间:2020-04-02 07:04:18

标签: ansible ansible-inventory python-2to3

我正在尝试使用AWS的ansible代码配置动态清单

这是ansible.cfg

中的配置
[defaults]
inventory       = ./inventory/ec2.py

当我尝试使用ansible -m command -a "ls" all检查主机时,出现以下错误

[WARNING]:  * Failed to parse /Users/Shammon/Projects/ansible/inventory/ec2.py with script plugin: Inventory script
(/Users/Shammon/Projects/ansible/inventory/ec2.py) had an execution error: Traceback (most recent call last):   File
"/Users/Shammon/Projects/ansible/inventory/ec2.py", line 135, in <module>     from ansible.module_utils import ec2 as ec2_utils
ModuleNotFoundError: No module named 'ansible'

 [WARNING]:  * Failed to parse /Users/<user-name>/Projects/ansible/inventory/ec2.py with ini plugin:
/Users/<name>/Projects/ansible/inventory/ec2.py:3: Error parsing host definition ''''': No closing quotation

 [WARNING]: Unable to parse /Users/<user-name>/Projects/ansible/inventory/ec2.py as an inventory source

Ansible版本:

ansible 2.4.3.0
  executable location = /Users/<user-name>/Library/Python/2.7/bin/ansible

0 个答案:

没有答案