---
- name: Set fact
  ansible.builtin.set_fact:
    nxos_json_text_parsed: "{{ lookup('ansible.builtin.file', '{{ role_path }}/output/nxos_show_interface_json_text.txt') }}"

- name: "Run command and parse with json {{ parser }}"
  ansible.utils.cli_parse:
    text: "{{ lookup('ansible.builtin.file', '{{ role_path }}/output/nxos_show_interface_json_text.txt') }}"
    parser:
      name: ansible.utils.json
  register: nxos_json_text

- name: "Confirm response {{ parser }}"
  ansible.builtin.assert:
    that: "{{ item }}"
  with_items:
    - "{{ nxos_json_text['parsed'] is defined }}"
    - "{{ nxos_json_text['parsed'][0][0][0]['admin_state'] is defined }}"
    - "{{ nxos_json_text['parsed'] == nxos_json_text_parsed }}"
