I'm trying to output a retrieved Juniper json config file using to_nice_json. I can't use a post playbook tool such as "json.tool" but I'd rather pull the config and save it in nice_json format. Below is my task that creates a serialized json file.
- name: Save device "json" config
juniper_junos_config:
provider: "{{ netconf }}"
retrieve: "committed"
format: "json"
dest: "{{ temp_config_file }}"
- name: Copy temp json file to timestamped file
copy:
src: "{{ temp_config_file }}"
dest: "{{ conf_file_json }}.json"