emm,获取ansible的host文件,总是提示我找不到文件?
来源:7-3 InventoryManager调用
慕妹7162846
2018-07-01
我的目录结构
wentaodeMacBook-Pro:ansible_api_demo wentao$ tree
.
├── all
└── bin.py
执行的代码;
inventory = InventoryManager(loader=DataLoader,sources=['/Users/wentao/PycharmProject/ansible_api_demo/all'])
无论是用绝对路径还是相对路径都不可以执行
[WARNING]: * Failed to parse /Users/wentao/PycharmProject/ansible_api_demo/all with yaml plugin: get_basedir() missing 1 required positional argument: 'self'
[WARNING]: * Failed to parse /Users/wentao/PycharmProject/ansible_api_demo/all with ini plugin: get_basedir() missing 1 required positional argument: 'self'
[WARNING]: Unable to parse /Users/wentao/PycharmProject/ansible_api_demo/all as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
1回答
-
慕妹7162846
提问者
2018-07-01
问题解决了,
忘记实例化 DataLoader()
00
相似问题