diff --git a/changelogs/fragments/fix_advanced_ldap_filters.yml b/changelogs/fragments/fix_advanced_ldap_filters.yml new file mode 100644 index 00000000..b24fa005 --- /dev/null +++ b/changelogs/fragments/fix_advanced_ldap_filters.yml @@ -0,0 +1,2 @@ +bugfixes: + - "Fix quoting for ! in templating Issue #208" diff --git a/roles/icingaweb2/templates/ini_template.j2 b/roles/icingaweb2/templates/ini_template.j2 index 9e80e30d..99f0e2b5 100644 --- a/roles/icingaweb2/templates/ini_template.j2 +++ b/roles/icingaweb2/templates/ini_template.j2 @@ -7,8 +7,10 @@ {{ option }} = "{{ value }}" {% elif value is iterable and (value is not string and value is not mapping) %} {{ option }} = "{{ value | join(', ') }}" +{% elif value|first == "!" %} +{{ option }} = {{ value | quote }} {% elif value is string and "=" in value %} -{{ option }} = "{{ value | quote }}" +{{ option }} = {{ value | quote }} {% else %} {{ option }} = {{ value }} {% endif %}