Ansible - Parsers relates to Ansible
Below Parser is included in this module
- class insights.parsers.ansible.AnsibleTelemetry(context, extra_bad_lines=None)[source]
Bases:
CommandParser,listParse the output of command “/usr/share/ansible/telemetry/telemetry.py”.
Sample output of the command is in NDJSON format:
{"collections":{"ansible.builtin":{"resources":{"action":{"ansible.builtin.command":13}},"version":"*"}},"ansible_core":{"version":"2.18.9rc1"}} {"collections":{"ansible.builtin":{"resources":{"action":{"ansible.builtin.command":14}},"version":"*"}},"ansible_core":{"version":"2.19.9"}}
- Raises:
SkipComponent -- when nothing is parsed.
ParseException -- when any line is not parsable for JSON.
Examples
>>> type(ansible_telemetry) <class 'insights.parsers.ansible.AnsibleTelemetry'> >>> ansible_telemetry[0]['collections']['ansible.builtin']['version'] == '*' True >>> ansible_telemetry[1]['ansible_core']['version'] == '2.19.9' True