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 …
… 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.
community.general.jc is a filter plugin, not a sub-plugin for the ansible.utils.cli_parse module. So you cannot use it with ansible.utils.cli_parse, unfortunately.
Thanks for the clarification. The cli_parse docs are not exactly clear what sub-plugins are supported, though on a re-read, there is no reference to jc. However in the more general docs on cli parsing under the section on the cli_parse module, jc is specifically mentioned as being supported with the that module, is this a different thing, or an error in the docs?