diff --git a/roles/stage-output/tasks/main.yaml b/roles/stage-output/tasks/main.yaml index 5b6d2f043..4b5924227 100644 --- a/roles/stage-output/tasks/main.yaml +++ b/roles/stage-output/tasks/main.yaml @@ -5,34 +5,18 @@ register: sources no_log: true -- name: Output a warning when input is not a dict and not empty - debug: - msg: "WARNING: extensions_to_txt is a list, values defined by parents will be overwritten" - when: - - extensions_to_txt is not mapping - - extensions_to_txt - -- name: Build the extensions list when input is not a dict (including empty) +- name: Build the extensions list from a dict (or empty) set_fact: extension_list: > - {% set extensions = ['__does_not_match__'] -%} + {% set extensions = ['__do_not_match__'] -%} {% if extensions_to_txt -%} - {% set extensions = extensions_to_txt -%} + {% for extension, extension_bool in extensions_to_txt.items() -%} + {% if extension_bool -%} + {% set _ = extensions.append(extension) -%} + {% endif -%} + {% endfor -%} {% endif -%} {{- extensions -}} - when: extensions_to_txt is not mapping - -- name: Build the extensions list when input is a dict - set_fact: - extension_list: > - {% set extensions = [] -%} - {% for extension, extension_bool in extensions_to_txt.items() -%} - {% if extension_bool -%} - {% set _ = extensions.append(extension) -%} - {% endif -%} - {% endfor -%} - {{- extensions -}} - when: extensions_to_txt is mapping - name: Build the extensions regular expression set_fact: