gpt4 book ai didi

python - ansible 动态库存错误

转载 作者:行者123 更新时间:2023-12-01 01:22:33 25 4
gpt4 key购买 nike

我正在尝试使用动态 list 来运行ansible play books。如果我运行 ec2.py --list 它工作正常,但是当我导出变量并运行 ping 失败并出现以下错误

export ANSIBLE_INVENTORY=$PATH/ec2.py
export EC2_INI_PATH=$PATH/ec2.ini
export PYTHONPATH=/venv/lib/python2.7/site-packages

cd $WORKSPACE/ansible

inventory list works. without any issues.
python $path/ec2.py --list

but when i tried to ping dynamic inventory it fails. ec2.py with script plugin: problem running $PATH/ec2.py --list ([Errno 13]

Permission denied) ansible -m ping tag_name_instancename

最佳答案

按照 the fine manual 指定:

... use Ansible’s -i command line option and specify the path to the script after marking it executable

它会为你运行,因为你使用脚本作为参数调用了 python 。如果您./ec2.py --list,它也应该可以工作,因为这也是 ansible 要做的事情

关于python - ansible 动态库存错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53675732/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com