开发者社区> 问答> 正文

如何为Ansible playbook选择python解释器

我有python2.7和python3.5在我的ansible服务器,而执行playbooks它是使用python2.7。我希望ansible使用python3.5当执行剧本。

 in order:
   1 have set export path.
   2 also changed default interpreter path in ansible.cfg as well.
   3 have given specific interpretor path in hostsfile for particular host.

但是,ansible并没有运行python3。 问题来源StackOverflow 地址:/questions/59380824/how-to-choose-a-python-interpreter-for-ansible-playbook

展开
收起
kun坤 2019-12-28 14:09:14 1331 0
1 条回答
写回答
取消 提交回答
  • 1)有ANSIBLE_PYTHON_INTERPRETER配置参数需要设置: 2) Python on controller的版本取决于Ansible是如何构建的。例如

    $ uname -a
    FreeBSD master.example.com 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64
    $ pkg info | grep ansible
    py27-ansible-2.8.5             Radically simple IT automation
    py36-ansible-2.8.5             Radically simple IT automation
    
    2019-12-28 14:09:19
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载