feat: add option allow_tranfer for zones

This commit is contained in:
Adrien Waksberg 2017-10-15 01:11:49 +02:00
parent 77f4d97787
commit 54ee906547
3 changed files with 17 additions and 1 deletions

View file

@ -24,6 +24,14 @@ end
end end
end end
describe file('/etc/bind/named.conf.local') do
it { should be_file }
it { should be_mode 644 }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
it { should contain '4.2.2.4' }
end
describe command('host hello.test.local 127.0.0.1') do describe command('host hello.test.local 127.0.0.1') do
its(:exit_status) { should eq 0 } its(:exit_status) { should eq 0 }
its(:stdout) { should contain('1.2.3.4') } its(:stdout) { should contain('1.2.3.4') }

View file

@ -8,6 +8,12 @@ zone "{{ zone }}" IN {
{% else %} {% else %}
file "/etc/bind/zones/db.{{ zone }}"; file "/etc/bind/zones/db.{{ zone }}";
{% endif %} {% endif %}
allow-transfer { 217.70.177.40; }; {% if 'allow_transfer' in value and value.dnssec %}
allow-transfer {
{% for ip in value.allow_transfer %}
{{ ip }};
{% endfor %}
};
{% endif %}
}; };
{% endfor %} {% endfor %}

View file

@ -4,6 +4,8 @@
bind_role: master bind_role: master
bind_zones: bind_zones:
test.local: test.local:
allow_transfer:
- '4.2.2.4'
ns_primary: ns1.test.local ns_primary: ns1.test.local
mail: root@test.local mail: root@test.local
serial: 2017092202 serial: 2017092202