Skip to content

Commit

Permalink
Ensure that lists are expanded (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterlexis authored and atosatto committed Sep 17, 2018
1 parent 4b8a313 commit a2ca13b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions molecule/resources/tests/all/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def test_config(host):
assert fc.user == 'root'
assert fc.group == 'root'
assert 'lua-config-file=' + fr.path in fc.content
assert 'allow-from=127.0.0.0/24,127.0.1.0/24,2001:DB8:10::/64' in \
fc.content

assert fr.exists
assert fr.user == 'root'
Expand Down
6 changes: 6 additions & 0 deletions molecule/resources/vars/pdns-rec-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ pdns_rec_config:
threads: 5
max-mthreads: 8192

# This tests that we expand lists to comma-separated configuration items
allow-from:
- 127.0.0.0/24
- 127.0.1.0/24
- '2001:DB8:10::/64'

pdns_rec_config_lua: "{{ pdns_rec_config_dir }}/rpz.lua"
pdns_rec_config_lua_file_content: |
rpzMaster("127.0.0.2", "rpz.test", {refresh=30})
Expand Down
4 changes: 4 additions & 0 deletions templates/recursor.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ setgid={{ pdns_rec_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 %}
Expand Down

0 comments on commit a2ca13b

Please sign in to comment.