Hi,
I installed ansible.utils ansible colelctions and used native parser and
XML parser (as Pyats genie parser did not work for a command i need to
parse).
But iam getting below error and not sure why it happens expecially when iam
following the syntax as given in documentation. Any pointers would be of
great help.
- name: Run command and parse with xml
ansible.utils.cli_parse:
command: "show interface"
parser:
name: ansible.utils.xml
os: ios
register: parser_output
- debug: var=parser_output.stdout_lines
TASK [Run command and parse with xml]
*****************************************************************************************************************************************************************************
fatal: [TEST2960]: FAILED! => {"changed": false, "msg": "/bin/sh: 1:
show: not found\n", "stdout": "", "stdout_lines": []}
---------------------------------------------------------------------------------------------------------------
tasks:
- name: GATHER SHOW IP
ios_command:
commands: "show ip interface brief"
register: show_ip
- name: Pass text and parse with xml
ansible.utils.cli_parse:
text: "{{ show_ip['stdout'] }}"
parser:
name: ansible.utils.xml
register: parser_output
TASK [Pass text and parse with xml]
*******************************************************************************************************************************************************************************
fatal: [TEST2960]: FAILED! => {"changed": false, "msg": "XML parser
returned an error while parsing. Error: a bytes-like object is required,
not 'list'"}
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/b6d68e16-10ab-49e7-8aaa-340000477f25n%40googlegroups.com.