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

后端 未结 19 1035
执念已碎
执念已碎 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:55

    Lots of answers.. Thanks for posting as I got started from this page too!

    I did a bit of digging and it was solid with Ubuntu 14.04LTS, Ubuntu 15.04LTS appeared to have dropped the latest python, and Ubuntu 16.04LTS appears to have dropped aptitude.

    I put the following action in my bootstrap before doing any apt calls:

    - name: "FIX: Ubuntu 16.04 LTS doesn't come with certain modules, required by ansible"
      raw: apt-get install python-minimal aptitude -y
      become: true
      become_user: root
      become_method: sudo
    

    If you manage become elsewhere, feel free to strip it.

    Sources:

    • https://github.com/ansible/ansible-modules-core/issues/3523#issuecomment-222368182
    • https://github.com/ansible/ansible/issues/16884#issuecomment-278138707

提交回复
热议问题