You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user, If I make a mistake in a matching directive or in the content: parameter, I may end up with one or more null values in the final variable output. For example, this playbook:
---
- hosts: iosconnection: network_cligather_facts: notasks:
- name: Collect version information from deviceios_command:
commands: "show version"register: ios_version_output
- import_role:
name: ansible-network.network-engine
- name: Generate version facts as JSONtext_parser:
file: "my_parsers/ios_show_version.yaml"content: ios_version_output['stdout_lines'][0]# in case anyone find this while looking for a *correct* example# the correct formulation would be # content: "{{ ios_version_output.stdout.0 }}"
- name: Display matches (system_facts)debug:
var: system_facts
The error in this example is in the content line, but a similar situation could occur if one or more match rules were incorrect. If I run the playbook with -vvvv I can see the directives:
processing directive: match version
processing directive: match model
processing directive: match image
processing directive: match uptime
processing directive: match total memory
processing directive: match free memory
processing directive: export system facts to playbook
but there's no information about which ones find matches.
To help debug issues with content lines and issues with match definitions, could we:
add "found match" or "no match" to verbose output for each directive processed
add information on total matches (for example, "7 matches found out of 8 match directives processed" - I'm not sure what level of verbosity should be required for this
The text was updated successfully, but these errors were encountered:
As a user, If I make a mistake in a matching directive or in the
content:
parameter, I may end up with one or morenull
values in the final variable output. For example, this playbook:succeeds, but returns this final variable:
The error in this example is in the
content
line, but a similar situation could occur if one or more match rules were incorrect. If I run the playbook with-vvvv
I can see the directives:but there's no information about which ones find matches.
To help debug issues with
content
lines and issues with match definitions, could we:The text was updated successfully, but these errors were encountered: