Merge "Remove support for extensions as lists"

This commit is contained in:
Zuul 2018-04-26 13:20:48 +00:00 committed by Gerrit Code Review
commit 655b466211
1 changed files with 7 additions and 23 deletions

View File

@ -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: