Skip to content

Commit

Permalink
Fix path to checkzone program on Bookworm, Jammy & Noble
Browse files Browse the repository at this point in the history
  • Loading branch information
smoeding committed Mar 21, 2024
1 parent 01a987a commit 0f4e40d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
4 changes: 4 additions & 0 deletions data/Debian-12.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Debian-12.yaml --- Settings for Debian-12 Bookworm
---

bind::checkzone_program: '/usr/bin/named-checkzone'
4 changes: 4 additions & 0 deletions data/Ubuntu-22.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ubuntu-22.04.yaml --- Settings for Ubuntu-22.04 Jammy
---

bind::checkzone_program: '/usr/bin/named-checkzone'
4 changes: 4 additions & 0 deletions data/Ubuntu-24.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ubuntu-24.04.yaml --- Settings for Ubuntu-24.04 Noble
---

bind::checkzone_program: '/usr/bin/named-checkzone'
4 changes: 3 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"20.04"
"20.04",
"22.04",
"24.04"
]
}
],
Expand Down
22 changes: 13 additions & 9 deletions spec/defines/zone/primary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
.with_group('bind')
.with_mode('0644')
.with_replace(true)
.with_validate_cmd('/usr/sbin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
.that_requires('Concat[named.conf.zones]')

is_expected.to contain_exec('bind::reload::example.com')
Expand All @@ -37,6 +36,19 @@
.with_order('20')
.with_content("\nzone \"example.com\" IN {\n type master;\n file \"/var/lib/bind/primary/com/example/db.example.com\";\n};\n")
}

case "#{facts[:os]['name']}-#{facts[:os]['release']['major']}"
when 'Debian-12', 'Ubuntu-22.04', 'Ubuntu-24.04'
it {
is_expected.to contain_file('/var/lib/bind/primary/com/example/db.example.com')
.with_validate_cmd('/usr/bin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
}
else
it {
is_expected.to contain_file('/var/lib/bind/primary/com/example/db.example.com')
.with_validate_cmd('/usr/sbin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
}
end
end

context 'with file => "/file"' do
Expand Down Expand Up @@ -70,7 +82,6 @@
.with_mode('0644')
.with_replace(true)
.with_source('/file')
.with_validate_cmd('/usr/sbin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
.that_requires('Concat[named.conf.zones]')

is_expected.to contain_exec('bind::reload::example.com')
Expand Down Expand Up @@ -103,7 +114,6 @@
.with_mode('0644')
.with_replace(true)
.with_content('something')
.with_validate_cmd('/usr/sbin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
.that_requires('Concat[named.conf.zones]')

is_expected.to contain_exec('bind::reload::example.com')
Expand Down Expand Up @@ -136,7 +146,6 @@
.with_mode('0644')
.with_replace(true)
.with_content('something')
.with_validate_cmd('/usr/sbin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
.that_requires('Concat[named.conf.zones]')

is_expected.to contain_exec('bind::reload::example.com')
Expand Down Expand Up @@ -465,7 +474,6 @@
.with_group('bind')
.with_mode('0644')
.with_replace(true)
.with_validate_cmd('/usr/sbin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
.that_requires('Concat[named.conf.zones]')

is_expected.to contain_exec('bind::reload::internal::example.com')
Expand Down Expand Up @@ -514,7 +522,6 @@
.with_mode('0644')
.with_replace(true)
.with_source('/file')
.with_validate_cmd('/usr/sbin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
.that_requires('Concat[named.conf.zones]')

is_expected.to contain_exec('bind::reload::internal::example.com')
Expand Down Expand Up @@ -547,7 +554,6 @@
.with_mode('0644')
.with_replace(true)
.with_content('something')
.with_validate_cmd('/usr/sbin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
.that_requires('Concat[named.conf.zones]')

is_expected.to contain_exec('bind::reload::internal::example.com')
Expand Down Expand Up @@ -580,7 +586,6 @@
.with_mode('0644')
.with_replace(true)
.with_content('something')
.with_validate_cmd('/usr/sbin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
.that_requires('Concat[named.conf.zones]')

is_expected.to contain_exec('bind::reload::internal::example.com')
Expand Down Expand Up @@ -889,7 +894,6 @@
.with_group('bind')
.with_mode('0644')
.with_replace(true)
.with_validate_cmd('/usr/sbin/named-checkzone -k fail -m fail -M fail -n fail example.com %')
.that_requires('Concat[named.conf.zones]')

is_expected.to contain_exec('bind::reload::internal::example.com')
Expand Down

0 comments on commit 0f4e40d

Please sign in to comment.