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

Additional parameters tkey-*
This commit is contained in:
Nate Riffe 2017-06-03 08:52:18 -05:00 committed by GitHub
commit 24fcf1d46c
3 changed files with 36 additions and 9 deletions

View File

@ -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 File

@ -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

View File

@ -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 -%>