ansible.utils/tests/integration/targets/utils_cli_parse/tasks/nxos_xml.yaml

19 lines
647 B
YAML

---
- ansible.builtin.set_fact:
nxos_xml_text_parsed: "{{ lookup('ansible.builtin.file', '{{ role_path }}/output/nxos_show_interface_xml_parsed.json') | from_json }}"
- name: "{{ parser }} Pass text and parse with xml"
ansible.utils.cli_parse:
text: "{{ lookup('ansible.builtin.file', '{{ role_path }}/files/nxos_show_interface.xml') }}"
parser:
name: ansible.utils.xml
os: nxos
register: nxos_xml_text
- name: "{{ parser }} Confirm response"
assert:
that: "{{ item }}"
with_items:
- "{{ nxos_xml_text['parsed'] == nxos_xml_text_parsed }}"
- "{{ nxos_xml_text['parsed']['nf:rpc-reply'] is defined }}"