diff --git a/changelogs/fragments/fix_issue_301.yml b/changelogs/fragments/fix_issue_301.yml new file mode 100644 index 00000000..19652485 --- /dev/null +++ b/changelogs/fragments/fix_issue_301.yml @@ -0,0 +1,2 @@ +bugfixes: + - "Certain values within Icinga Web :code:`ini` files got quoted incorrectly using single quotes. They are now quoted properly using double quotes (#301)." diff --git a/roles/icingaweb2/templates/ini_template.j2 b/roles/icingaweb2/templates/ini_template.j2 index 21b44bc2..f5ec9ac5 100644 --- a/roles/icingaweb2/templates/ini_template.j2 +++ b/roles/icingaweb2/templates/ini_template.j2 @@ -7,8 +7,8 @@ {{ option }} = "{{ value }}" {% elif value is iterable and (value is not string and value is not mapping) %} {{ option }} = "{{ value | join(', ') }}" -{% elif ( value is string and ( "=" in value or "!" in value ) )%} -{{ option }} = '{{ value }}' +{% elif ( value is string and ( "=" in value or "!" in value or " " in value ) )%} +{{ option }} = "{{ value }}" {% else %} {{ option }} = {{ value }} {% endif %}