print to nice json

This commit is contained in:
Matthew Stobbs
2025-03-25 13:56:37 -06:00
parent 5fb7781945
commit 7aa1c3c12e

View File

@@ -74,21 +74,21 @@
- ansible_system == 'Linux' - ansible_system == 'Linux'
- pkg_appimage|length > 0 - pkg_appimage|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_appimage | to_yaml }}" content: "{{ pkg_appimage | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_appimage.yml" dest: "{{ d_tempdir.path }}/pkg_appimage.yml"
mode: '0644' mode: '0644'
- name: List archives - name: List archives
when: when:
- pkg_archive|length > 0 - pkg_archive|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_archive | to_yaml }}" content: "{{ pkg_archive | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_archive.yml" dest: "{{ d_tempdir.path }}/pkg_archive.yml"
mode: '0644' mode: '0644'
- name: List cargo - name: List cargo
when: when:
- pkg_cargo|length > 0 - pkg_cargo|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_cargo | to_yaml }}" content: "{{ pkg_cargo | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_cargo.yml" dest: "{{ d_tempdir.path }}/pkg_cargo.yml"
mode: '0644' mode: '0644'
- name: List casks - name: List casks
@@ -96,7 +96,7 @@
- ansible_system == 'Darwin' - ansible_system == 'Darwin'
- pkg_cask|length > 0 - pkg_cask|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_cask | to_yaml }}" content: "{{ pkg_cask | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_cask.yml" dest: "{{ d_tempdir.path }}/pkg_cask.yml"
mode: '0644' mode: '0644'
- name: List flatpak remotes - name: List flatpak remotes
@@ -104,7 +104,7 @@
- ansible_system == 'Linux' - ansible_system == 'Linux'
- flatpak_remote|length > 0 - flatpak_remote|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ flatpak_remote | to_yaml }}" content: "{{ flatpak_remote | to_nice_json }}"
dest: "{{ d_tempdir.path }}/flatpak_remote.yml" dest: "{{ d_tempdir.path }}/flatpak_remote.yml"
mode: '0644' mode: '0644'
- name: List flatpaks - name: List flatpaks
@@ -112,42 +112,42 @@
- ansible_system == 'Linux' - ansible_system == 'Linux'
- pkg_flatpak|length > 0 - pkg_flatpak|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_flatpak | to_yaml }}" content: "{{ pkg_flatpak | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_flatpak.yml" dest: "{{ d_tempdir.path }}/pkg_flatpak.yml"
mode: '0644' mode: '0644'
- name: List go - name: List go
when: when:
- pkg_go|length > 0 - pkg_go|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_go | to_yaml }}" content: "{{ pkg_go | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_go.yml" dest: "{{ d_tempdir.path }}/pkg_go.yml"
mode: '0644' mode: '0644'
- name: List npm - name: List npm
when: when:
- pkg_npm|length > 0 - pkg_npm|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_npm | to_yaml }}" content: "{{ pkg_npm | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_npm.yml" dest: "{{ d_tempdir.path }}/pkg_npm.yml"
mode: '0644' mode: '0644'
- name: List pipx - name: List pipx
when: when:
- pkg_pipx|length > 0 - pkg_pipx|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_pipx | to_yaml }}" content: "{{ pkg_pipx | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_pipx.yml" dest: "{{ d_tempdir.path }}/pkg_pipx.yml"
mode: '0644' mode: '0644'
- name: List source - name: List source
when: when:
- pkg_src|length > 0 - pkg_src|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_src | to_yaml }}" content: "{{ pkg_src | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_src.yml" dest: "{{ d_tempdir.path }}/pkg_src.yml"
mode: '0644' mode: '0644'
- name: List system - name: List system
when: when:
- pkg_sys|length > 0 - pkg_sys|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_sys | to_yaml }}" content: "{{ pkg_sys | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_sys.yml" dest: "{{ d_tempdir.path }}/pkg_sys.yml"
mode: '0644' mode: '0644'
- name: List homebrew taps - name: List homebrew taps
@@ -155,7 +155,7 @@
- ansible_system == 'Darwin' - ansible_system == 'Darwin'
- brewtap|length > 0 - brewtap|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ brewtap | to_yaml }}" content: "{{ brewtap | to_nice_json }}"
dest: "{{ d_tempdir.path }}/brewtap.yml" dest: "{{ d_tempdir.path }}/brewtap.yml"
mode: '0644' mode: '0644'
- name: List taps - name: List taps
@@ -163,7 +163,7 @@
- ansible_system == 'Darwin' - ansible_system == 'Darwin'
- pkg_tap|length > 0 - pkg_tap|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_tap | to_yaml }}" content: "{{ pkg_tap | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_tap.yml" dest: "{{ d_tempdir.path }}/pkg_tap.yml"
mode: '0644' mode: '0644'
- name: List snaps - name: List snaps
@@ -171,7 +171,7 @@
- ansible_system == 'Linux' - ansible_system == 'Linux'
- pkg_snap|length > 0 - pkg_snap|length > 0
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ pkg_snap | to_yaml }}" content: "{{ pkg_snap | to_nice_json }}"
dest: "{{ d_tempdir.path }}/pkg_snap.yml" dest: "{{ d_tempdir.path }}/pkg_snap.yml"
mode: '0644' mode: '0644'