community / community.general / 3.8.10 / filter / jc Convert output of many shell commands and file-types to JSON | "added in version" 1.1.0 of community.general" Authors: Kelly Brazil (@kellyjonbrazil)community.general.jc (3.8.10) — filter
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
Convert output of many shell commands and file-types to JSON.
Uses the L(jc library,https://github.com/kellyjonbrazil/jc).
- name: Run command ansible.builtin.command: uname -a register: result
- name: Convert command's result to JSON ansible.builtin.debug: msg: "{{ result.stdout | community.general.jc('uname') }}"
raw: default: false description: Set to C(true) to return pre-processed JSON. type: boolean quiet: default: true description: Set to C(false) to not suppress warnings. type: boolean _input: description: The data to convert. required: true type: string parser: description: - The correct parser for the input data. - For exmaple C(ifconfig). - See U(https://github.com/kellyjonbrazil/jc#parsers) for the latest list of parsers. required: true type: string
_value: description: The processed output. type: any