I’d like to use the ‘jc’ parser in the module ‘ansible.utils.cli_parse’ but I cannot figure out to set the jc specific parser in the module parameter. When I try the following …
- ansible.utils.cli_parse:
command: ps
parser:
name: community.general.jc
vars:
parser: ps
set_fact: _ps_output
… I get the error fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error loading parser: No module named 'ansible_collections.community.general.plugins.sub_plugins'"}
I believe that ‘jc’ is functioning otherwise as that below provides a nice JSON list of dicts.
- ansible.builtin.command: ps
register: _ps_output
- ansible.builtin.debug:
msg: "{{ _ps_output.stdout | community.general.jc('ps') }}"