From 55aa3c3fa79dc89148da68966d85867f1d6f9754 Mon Sep 17 00:00:00 2001 From: Andrea Tosatto Date: Sun, 2 Dec 2018 20:23:49 +0000 Subject: [PATCH] Ensure that lists are expanded in the PowerDNS configuration template (#55) --- CHANGELOG.md | 5 ++++- templates/pdns.conf.j2 | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75143fb..52829c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ -## v1.3.1 (Unreleased) +## v1.4.0 (Unreleased) + +BUG FIXES: +- Ensure that lists are expanded in the PowerDNS configuration template ([\#55](https://github.com/PowerDNS/pdns-ansible/pull/55)) NEW FEATURES: - Add an option (`pdns_disable_handlers`) to disable the automated restart of the service on configuration changes ([\#54](https://github.com/PowerDNS/pdns-ansible/pull/54)) diff --git a/templates/pdns.conf.j2 b/templates/pdns.conf.j2 index d98a984..86817f3 100644 --- a/templates/pdns.conf.j2 +++ b/templates/pdns.conf.j2 @@ -7,6 +7,10 @@ setgid={{ pdns_group }} {{ config_item }}=yes {% elif value == False %} {{ config_item }}=no +{% elif value is string %} +{{ config_item }}={{ value | string }} +{% elif value is sequence %} +{{ config_item }}={{ value | join(',') }} {% else %} {{ config_item }}={{ value | string }} {% endif %} @@ -21,9 +25,9 @@ launch+={{ backend }} {% for backend_item, value in pdns_backends[backend].items() | sort() -%} {% if value == True %} {{ backend_string }}-{{ backend_item }}=yes -{% elif backend_item == False %} +{% elif value == False %} {{ backend_string }}-{{ backend_item }}=no -{% elif backend_item == None %} +{% elif value == None %} {{ backend_string }}-{{ backend_item }}= {% else %} {{ backend_string }}-{{ backend_item }}={{ value | string }}