19 lines
542 B
YAML
19 lines
542 B
YAML
---
|
|
- name: "{{ parser }} Run command and parse with textfsm"
|
|
ansible.utils.cli_parse:
|
|
command: "ifconfig"
|
|
parser:
|
|
name: ansible.utils.textfsm
|
|
set_fact: myfact
|
|
register: ifconfig_out
|
|
|
|
- name: "{{ parser }} Check parser output"
|
|
assert:
|
|
that: "{{ item }}"
|
|
with_items:
|
|
- "{{ myfact is defined }}"
|
|
- "{{ ifconfig_out['stdout'] is defined }}"
|
|
- "{{ ifconfig_out['stdout_lines'] is defined }}"
|
|
- "{{ ifconfig_out['parsed'] is defined }}"
|
|
- "{{ ifconfig_out['parsed'][0]['Interface'] is defined }}"
|