Permalink
Browse files

Merge pull request #128 from cedef/feature/add-params

Additional parameters tkey-*
  • Loading branch information...
inkblot committed Jun 3, 2017
2 parents e39b9b9 + 81135ef commit 24fcf1d46ce4025517f6e2376c39a98e5db76885
Showing with 36 additions and 9 deletions.
  1. +11 −9 manifests/init.pp
  2. +19 −0 spec/classes/bind_spec.rb
  3. +6 −0 templates/named.conf.erb
View
@@ -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 {
View
@@ -73,13 +73,32 @@
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',
name: expected_bind_service
})
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
View
@@ -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 -%>

0 comments on commit 24fcf1d

Please sign in to comment.