From 3a75d3247211cee63fcd2e4167aa2928e3a07584 Mon Sep 17 00:00:00 2001 From: nd Date: Mon, 30 Sep 2019 02:19:11 +0200 Subject: [PATCH] add support for multiple backends --- defaults/main.yml | 2 +- templates/pdns.conf.j2 | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b8b0011..d6e0573 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -10,7 +10,7 @@ powerdns: "guardian": "yes" "include-dir": "/etc/powerdns/pdns.d" "launch": - - bind + bind: {} "master": "no" "reuseport": "yes" "setgid": pdns diff --git a/templates/pdns.conf.j2 b/templates/pdns.conf.j2 index 4af1ba8..a2cd7f2 100644 --- a/templates/pdns.conf.j2 +++ b/templates/pdns.conf.j2 @@ -1,6 +1,7 @@ -{% set array_values = ['allow-axfr-ips', 'launch'] %} +{% set array_values = ['allow-axfr-ips'] %} +{% set dict_array_values = ['launch'] %} {% for option in powerdns.config.keys()|sort %} -{{ option }}={% if option in array_values %}{{ powerdns.config[option]|join(',' ) }}{% else %}{{ powerdns.config[option] }}{% endif %} +{{ option }}={% if option in array_values %}{{ powerdns.config[option]|join(',' ) }}{% elif option in dict_array_values %}{{ powerdns.config[option].keys()|sort()|join(',' ) }}{% else %}{{ powerdns.config[option] }}{% endif %} {% endfor %}