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 %}