Skip to content

Commit

Permalink
fix: ansible-core-2.16 - only use to_nice_json for output formatting
Browse files Browse the repository at this point in the history
Cause: The code was using `to_nice_json` to construct a list used for
further processing.

Consequence: The variable was evaluated as a `string`, not a `list`
and was causing no files to match.

Fix: Remove the `to_nice_json` so the variable is evaluated as
a `list`.

Result: The code works as expected.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
  • Loading branch information
richm committed Dec 7, 2023
1 parent 010ce0b commit d5411ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roles/rsyslog/tasks/main_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
__rsyslog_current_files: "{{ __rsyslog_template_results |
selectattr('results', 'defined') | map(attribute='results') |
flatten | selectattr('dest', 'defined') | map(attribute='dest') |
list | to_nice_json }}"
list }}"
__rsyslog_files_to_remove: "{{
__rsyslog_confs.stdout_lines | difference(__rsyslog_current_files) }}"

Expand Down

0 comments on commit d5411ee

Please sign in to comment.