Ansible fails with /bin/sh: 1: /usr/bin/python: not found

后端 未结 19 1109
执念已碎
执念已碎 2020-11-29 15:15

I\'m running into an error I\'ve never seen before. Here is the command and the error:

$ ansible-playbook create_api.yml

PLAY [straw] **********************         


        
19条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 15:37

    Ansible 2.2 features a tech preview of Python 3 support. To take advantage of this (so you don't have to install Python 2 on Ubuntu 16.04), just set the ansible_python_interpreter config option to /usr/bin/python3. This can be done on a per-host basis in your inventory file:

    [db]
    123.123.123.123 ansible_python_interpreter=/usr/bin/python3
    

提交回复
热议问题