Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change sysconfig_file for Debian/Ubuntu to '/etc/default/named' #235

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
'Ubuntu' => if versioncmp($facts['os']['release']['major'], '22.04') >= 0 { '/usr/bin/named-checkconf' } else { '/usr/sbin/named-checkconf' },
default => '/usr/sbin/named-checkconf',
}
$sysconfig_file = '/etc/default/bind9'
$sysconfig_file = $facts['os']['name'] ? {
'Debian' => '/etc/default/bind9',
'Ubuntu' => if versioncmp($facts['os']['release']['major'], '20.04') >= 0 { '/etc/default/named' } else { '/etc/default/bind9' },
default => '/etc/default/named',
}
$sysconfig_template = "dns/sysconfig.${facts['os']['family']}.erb"
$sysconfig_startup_options = '-u bind'
$sysconfig_resolvconf_integration = false
Expand Down
4 changes: 3 additions & 1 deletion spec/classes/dns_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,15 @@
}
end

context 'sysconfig', if: ['Debian', 'RedHat'].include?(os_facts[:os]['family']) do
context 'sysconfig', if: ['Debian', 'RedHat', 'Ubuntu'].include?(os_facts[:os]['family']) do
let(:sysconfig_named_path) do
case facts[:os]['family']
when 'RedHat'
'/etc/sysconfig/named'
when 'Debian'
'/etc/default/bind9'
when 'Ubuntu'
facts[:os]['release']['major'] == '18.04' ? '/etc/default/bind9' : '/etc/default/named'
end
end

Expand Down Expand Up @@ -450,7 +452,7 @@
end
end

it do

Check failure on line 455 in spec/classes/dns_init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

dns on ubuntu-20.04-x86_64 sysconfig default parameters is expected to contain File[/etc/default/bind9] with owner => "root", group => "root", mode => "0644" and content supplied string Failure/Error: should contain_file(sysconfig_named_path).with( owner: 'root', group: 'root', mode: '0644', content: sysconfig_named_content ) expected that the catalogue would contain File[/etc/default/bind9]

Check failure on line 455 in spec/classes/dns_init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

dns on ubuntu-22.04-x86_64 sysconfig default parameters is expected to contain File[/etc/default/bind9] with owner => "root", group => "root", mode => "0644" and content supplied string Failure/Error: should contain_file(sysconfig_named_path).with( owner: 'root', group: 'root', mode: '0644', content: sysconfig_named_content ) expected that the catalogue would contain File[/etc/default/bind9]
should contain_file(sysconfig_named_path).with(
owner: 'root',
group: 'root',
Expand Down Expand Up @@ -524,7 +526,7 @@
SYSCONFIG
end

it {

Check failure on line 529 in spec/classes/dns_init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

dns on ubuntu-20.04-x86_64 sysconfig with Debian sysconfig settings is expected to contain File[/etc/default/bind9] with owner => "root", group => "root", mode => "0644" and content supplied string Failure/Error: should contain_file(sysconfig_named_path).with( owner: 'root', group: 'root', mode: '0644', content: sysconfig_named_content ) expected that the catalogue would contain File[/etc/default/bind9]

Check failure on line 529 in spec/classes/dns_init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

dns on ubuntu-22.04-x86_64 sysconfig with Debian sysconfig settings is expected to contain File[/etc/default/bind9] with owner => "root", group => "root", mode => "0644" and content supplied string Failure/Error: should contain_file(sysconfig_named_path).with( owner: 'root', group: 'root', mode: '0644', content: sysconfig_named_content ) expected that the catalogue would contain File[/etc/default/bind9]
should contain_file(sysconfig_named_path).with(
owner: 'root',
group: 'root',
Expand All @@ -545,7 +547,7 @@
}
end

it {

Check failure on line 550 in spec/classes/dns_init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

dns on ubuntu-20.04-x86_64 sysconfig with additional sysconfig settings Failure/Error: verify_contents(catalogue, sysconfig_named_path, [ 'BAZ="quux"', 'FOO="bar"', 'export SOMETHING="other"', ]) NoMethodError: undefined method `parameters' for nil:NilClass

Check failure on line 550 in spec/classes/dns_init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

dns on ubuntu-22.04-x86_64 sysconfig with additional sysconfig settings Failure/Error: verify_contents(catalogue, sysconfig_named_path, [ 'BAZ="quux"', 'FOO="bar"', 'export SOMETHING="other"', ]) NoMethodError: undefined method `parameters' for nil:NilClass
verify_contents(catalogue, sysconfig_named_path, [
'BAZ="quux"',
'FOO="bar"',
Expand Down
Loading