apiVersion: v1 kind: ConfigMap metadata: name: {{ vars.cuddle_vars.service }}-config data: {%- if (vars.cluster_vars.env | items | length) > 0 %} environment: {%- for (name, value) in vars.cluster_vars.env | dictsort %} {{name | upper | replace(".", "_") | replace("-", "_") }}: {{value}} {%- endfor %} {%- endif %}