From 19d80e9aef5486f294b3b0b45540e3fbaabb4bd1 Mon Sep 17 00:00:00 2001 From: Adrien Waksberg Date: Sat, 17 Mar 2018 20:39:53 +0100 Subject: [PATCH] feat: add zones options --- README.md | 4 ++++ templates/named.conf.local.j2 | 5 +++++ test/integration/bind/default.yml | 4 ++++ test/integration/bind/serverspec/bind_spec.rb | 1 + 4 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 3990c92..17ab757 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,10 @@ bind_zones: mail: root@hello.local serial: 2017092201 dnssec: no + options: + key-directory: '"/etc/bind/keys"' + auto-dnssec: maintain + inline-signing: yes records: - { name: '@', type: ns, value: localhost. } - { name: hello, type: a, value: 4.3.2.1 } diff --git a/templates/named.conf.local.j2 b/templates/named.conf.local.j2 index 6a9dc9d..68b1c4e 100644 --- a/templates/named.conf.local.j2 +++ b/templates/named.conf.local.j2 @@ -15,5 +15,10 @@ zone "{{ zone }}" IN { {% endfor %} }; {% endif %} +{% if 'options' in value %} +{% for option, opt_value in value.options.iteritems() %} + {{ option }} {% if opt_value == True %}yes{% elif opt_value == False %}no{% else %}{{ opt_value }}{% endif %}; +{% endfor %} +{% endif %} }; {% endfor %} diff --git a/test/integration/bind/default.yml b/test/integration/bind/default.yml index 5a4da04..0cfcb0a 100644 --- a/test/integration/bind/default.yml +++ b/test/integration/bind/default.yml @@ -16,6 +16,10 @@ expire: 2419200 negative_cache: 86400 dnssec: yes + options: + auto-dnssec: maintain + inline-signing: yes + key-directory: '"/etc/bind/keys"' records: - { name: '@', type: mx, priority: 20, value: mail.test.local. } - { name: '@', type: ns, value: localhost. } diff --git a/test/integration/bind/serverspec/bind_spec.rb b/test/integration/bind/serverspec/bind_spec.rb index f221046..a7a20d1 100644 --- a/test/integration/bind/serverspec/bind_spec.rb +++ b/test/integration/bind/serverspec/bind_spec.rb @@ -35,6 +35,7 @@ describe file('/etc/bind/named.conf.local') do it { should be_owned_by 'root' } it { should be_grouped_into 'root' } it { should contain '4.2.2.4' } + it { should contain 'inline-signing yes;' } end describe file('/etc/bind/named.conf.options') do