From 81135efa23faaab68043e7343d3d3d71f93d8742 Mon Sep 17 00:00:00 2001 From: Cedric DEFORTIS Date: Wed, 31 May 2017 15:41:52 +0200 Subject: [PATCH] tkey-* additional parameters - tkey-gssapi-credential - tkey-domain --- manifests/init.pp | 20 +++++++++++--------- spec/classes/bind_spec.rb | 19 +++++++++++++++++++ templates/named.conf.erb | 6 ++++++ 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 40b39d6..395ec92 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,15 +1,17 @@ # ex: syntax=puppet si ts=4 sw=4 et class bind ( - $forwarders = undef, - $forward = undef, - $dnssec = undef, - $filter_ipv6 = undef, - $version = undef, - $statistics_port = undef, - $auth_nxdomain = undef, - $include_default_zones = true, - $include_local = false, + $forwarders = undef, + $forward = undef, + $dnssec = undef, + $filter_ipv6 = undef, + $version = undef, + $statistics_port = undef, + $auth_nxdomain = undef, + $include_default_zones = true, + $include_local = false, + $tkey_gssapi_credential = undef, + $tkey_domain = undef, ) inherits bind::defaults { File { diff --git a/spec/classes/bind_spec.rb b/spec/classes/bind_spec.rb index 69ff50f..e549b01 100644 --- a/spec/classes/bind_spec.rb +++ b/spec/classes/bind_spec.rb @@ -73,6 +73,11 @@ describe 'bind' do end it { is_expected.to contain_file(expected_named_conf).that_requires('Package[bind]') } it { is_expected.to contain_file(expected_named_conf).that_notifies('Service[bind]') } + it do + is_expected.to contain_file(expected_named_conf) + .with_content(/^options {$/) + .without_content(/^\s+tkey-gssapi-credential/) + end it do is_expected.to contain_service('bind').with({ ensure: 'running', @@ -80,6 +85,20 @@ describe 'bind' do }) end end + context 'with tkey-* parameters' do + let(:params) do + { + tkey_gssapi_credential: 'DNS/ds01.foobar.com', + tkey_domain: 'foobar.com' + } + end + it do + is_expected.to contain_file(expected_named_conf) + .with_content(/^options {$/) + .with_content(%r{^\s+tkey-gssapi-credential "DNS/ds01.foobar.com";$}) + .with_content(%r{^\s+tkey-domain "foobar.com";$}) + end + end end end end diff --git a/templates/named.conf.erb b/templates/named.conf.erb index 65a7d1d..a69f4ef 100644 --- a/templates/named.conf.erb +++ b/templates/named.conf.erb @@ -42,6 +42,12 @@ options { <%- if @version != '' -%> version "<%= @version %>"; <%- end -%> +<%- if @tkey_gssapi_credential -%> + tkey-gssapi-credential "<%= @tkey_gssapi_credential %>"; +<%- end -%> +<%- if @tkey_domain -%> + tkey-domain "<%= @tkey_domain %>"; +<%- end -%> }; <%- if @include_local -%>