Automation

Ansible for Juniper on Ubuntu -- Interpreter error

  • 1.  Ansible for Juniper on Ubuntu -- Interpreter error

    Posted 01-19-2021 08:38
    Hi Im having trouble setting up my ansible playbook to run for juniper on ubuntu 20.04  .. While it works for  other vendors
    Junos version : vsrx12.1X47-D20.7 

    At this point Im stuck at getting python3 to work as the interpreter, any working solutions will be most appreciated.
    Ive checked google, github, Ansible & Ubuntu documentation neither solved my problem ( or maybe I just couldnt find the right solution ).
    Ive also tried installing & using python 2.7 ... See Error below

    fatal: [Ikeja]: FAILED! => {"changed": false, "module_stderr": "/bin/sh: 1: /usr/bin/python3.8.5: not found\n", "module_stdout": "", "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error", "rc": 127}

    Ive edited the Interpreter in multiple locations fro both python3 & 3.8 without luck.. See below
    ---Hostfile--
    [junos]
    Ikeja ansible_python_interpreter=/usr/bin/python3
    Uyo

    [junos:vars]
    ansible_python_interpreter=/usr/bin/python3

    ---Ansible cofig file ( /etc/ansible/ansible.cfg )------
    [defaults]
    ansible_python_interpreter=/usr/bin/python3

    ----- .bashrc file ------
    alias python="/usr/bin/python3"

    root@treadstone:~# ls /usr/bin/python*
    /usr/bin/python3 <-------- This is blue all others below are green
    /usr/bin/python3.8
    /usr/bin/python3-futurize
    /usr/bin/python3-pasteurize
    /usr/bin/python-argcomplete-check-easy-install-script3
    /usr/bin/python-argcomplete-tcsh3


    ------------------------------
    OKEY CHIMEH
    ------------------------------