I want to create a playbook to get info and backup my Juniper Ex3400 switch. And i have faced some issue when followed the guide on internet. Here is my playbook and error. It' seems the juniper_junos_command
cannot recognize, and all the required module was downloaded.
- name: get_config Ansible module
hosts: HK01
roles:
- Juniper.junos
connection: local
gather_facts: no
tasks:
- name: Execute the get_config RPC#
juniper_junos_command:
commands:
- "show version"
register: junos_result
- name: Print Version
debug:
var: junos_result
FAILED! => {"changed": false, "module_stderr": "/home/leoltchan/.ansible/tmp/ansible-local-29004o9si_nf/ansible-tmp-1616579584.8777056-2906-176519637998237/AnsiballZ_juniper_junos_command.py:
line 3: _ANSIBALLZ_WRAPPER: command not found\n/home/leoltchan/.ansible/tmp/ansible-local-29004o9si_nf/ansible-tmp-
1616579584.8777056-2906-176519637998237/AnsiballZ_juniper_junos_command.py:
line 4: syntax error near unexpected token `('\n/home/leoltchan/.ansible/tmp/ansible-local-29004o9si_nf/ansible-tmp-1616579584.8777056-2906-
176519637998237/AnsiballZ_juniper_junos_command.py: line 4: `def _ansiballz_main():'\n", "module_stdout": "", "msg":
"MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 2}
And here is my host inventory
[HK01]
192.168.8.250
[HK01:vars]
ansible_connection=ansible.netcommon.netconf
ansible_network_os=junipernetworks.junos.junos
ansible 2.10.7 config file = /etc/ansible/ansible.cfg configured module search path = ['/home/leoltchan/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.6/site-packages/ansible executable location = /usr/local/bin/ansible python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]