diff --git a/changelogs/fragments/103-improve-info-role.yml b/changelogs/fragments/103-improve-info-role.yml new file mode 100644 index 00000000..30c371ab --- /dev/null +++ b/changelogs/fragments/103-improve-info-role.yml @@ -0,0 +1,4 @@ +--- +minor_changes: + - info - changed default filenames from randomly generated string to static filename to remove community dependency + - info - added optional output variable which includes gathered info diff --git a/roles/info/tasks/main.yml b/roles/info/tasks/main.yml index 2c52df19..5793d2d5 100644 --- a/roles/info/tasks/main.yml +++ b/roles/info/tasks/main.yml @@ -31,9 +31,9 @@ - name: Expose Gathered Facts As Variable vmware_ops_info_outputs ansible.builtin.set_fact: vmware_ops_info_outputs: - license: "{{ __license.licenses | first | default({}) }}" + license: "{{ __license.licenses | default([]) }}" appliance: "{{ __appliance.appliance | default({}) }}" - guest: "{{ __guests.guests | first | default({}) }}" - cluster: "{{ __clusters_info.results | map(attribute='clusters') | default({}) }}" - storage: "{{ __storage_policy.spbm_profiles | first | default({}) }}" + guest: "{{ __guests.guests | default([]) }}" + cluster: "{{ _clusters_info.results | default([]) | map(attribute='clusters') }}" + storage: "{{ __storage_policy.spbm_profiles | default([]) }}" when: info_expose_outputs_as_variable