ansible_python_interpreter在异源环境中设置
我一直在努力对Debian 8和Debian 10 Docker Images进行我的Ansible分子测试。由于Debian 10 Docker Image默认情况下,Python 3随附,没有'/usr/bin/python'symlink文件。因此,当在Debian 10 Docker容器上运行时,分子测试失败,因为它无法/usr/bin/python文件。将ANSIBLE_PYTHON_INTERPRETER变量设置为“/usr/bin/python3”将使分子测试在Debian 8 Docker容器上失败,因为它仅安装了Python2。
有人可以为此提出解决方法吗?如果Ansible本身检测到节点上的Python版本,那将是很好的,但不幸的是,情况并非如此。
I have been working on getting my Ansible molecule testing working on both Debian 8 and Debian 10 docker images. As Debian 10 docker images comes with python 3 by default with no '/usr/bin/python' symlink file. Due to this, molecule testing when run on Debian 10 docker container fails as it cannot /usr/bin/python file. Setting ansible_python_interpreter variable to '/usr/bin/python3' will make molecule test fail on Debian 8 docker containers as it only has python2 installed.
Could someone suggest as possible workaround for this? It would have been good if Ansible itself detects version of python installed on a node but unfortunately thats not the case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论