Ansible integration - python in a different location



  • Hi guys,
    I'm looking to run playbooks against my pfSense installations.

    When running a generic ping from Ansible to the application, I get the following error:

    10.50.3.1 | FAILED! => {
        "changed": false,
        "module_stderr": "/bin/sh: /usr/bin/python: not found\n",
        "module_stdout": "",
        "msg": "MODULE FAILURE",
        "rc": 127
    }
    

    When logging onto the application via shell, I can see Python 2.7 is installed, just under a different location:

    [2.4.3-RELEASE][root@hostname_here]/root: which python2.7
    /usr/local/bin/python2.7
    

    Does anyone have any experience with changing this, or a workaround at all?

    I'm not all that familiar with FreeBSD and obviously don't want to break anything  :o

    Any advise would be great.



  • @dsgnr This is an Ansible configuration issue, see Ansible FAQ.



  • Hi !

    I have already the same problem.

    If you have this error :

    10.50.3.1 | FAILED! => {
    "changed": false,
    "module_stderr": "/bin/sh: /usr/bin/python: not found\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 127
    }

    You can pass the interpreter /usr/local/bin/python2.7 in Ansible Variable !

    In the /etc/ansible/hosts file you can put :

    fqdn_server ansible_python_interpreter: /usr/local/bin/python2.7

    After this modification it's work fine !