{% set array_values = ['allow-axfr-ips', 'launch'] %} {% for option in powerdns.config.keys()|sort %} {{ option }}={% if option in array_values %}{{ powerdns.config[option]|join(',' ) }}{% else %}{{ powerdns.config[option] }}{% endif %} {% endfor %}