2020-12-02 13:57:56 +00:00
|
|
|
---
|
2022-12-28 07:07:35 +00:00
|
|
|
- name: "Run command and parse with ttp {{ parser }}"
|
2020-12-02 13:57:56 +00:00
|
|
|
ansible.utils.cli_parse:
|
|
|
|
command: "df -h"
|
|
|
|
parser:
|
|
|
|
name: ansible.utils.ttp
|
2022-11-29 13:58:12 +00:00
|
|
|
ansible.builtin.set_fact: myfact
|
2020-12-02 13:57:56 +00:00
|
|
|
register: df_h_out
|
|
|
|
|
2022-12-28 07:07:35 +00:00
|
|
|
- name: "Check parser output {{ parser }}"
|
2022-11-29 13:58:12 +00:00
|
|
|
ansible.builtin.assert:
|
2020-12-02 13:57:56 +00:00
|
|
|
that: "{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- "{{ myfact is defined }}"
|
|
|
|
- "{{ df_h_out['stdout'] is defined }}"
|
|
|
|
- "{{ df_h_out['stdout_lines'] is defined }}"
|
|
|
|
- "{{ df_h_out['parsed'] is defined }}"
|
|
|
|
- "{{ df_h_out['parsed'][0][0][0]['Filesystem'] is defined }}"
|