diff --git a/data/Debian-12.yaml b/data/Debian-12.yaml new file mode 100644 index 0000000..0dc6bff --- /dev/null +++ b/data/Debian-12.yaml @@ -0,0 +1,4 @@ +# Debian-12.yaml --- Settings for Debian-12 Bookworm +--- + +bind::checkzone_program: '/usr/bin/named-checkzone' diff --git a/data/Ubuntu-22.04.yaml b/data/Ubuntu-22.04.yaml new file mode 100644 index 0000000..a586386 --- /dev/null +++ b/data/Ubuntu-22.04.yaml @@ -0,0 +1,4 @@ +# Ubuntu-22.04.yaml --- Settings for Ubuntu-22.04 Jammy +--- + +bind::checkzone_program: '/usr/bin/named-checkzone' diff --git a/data/Ubuntu-24.04.yaml b/data/Ubuntu-24.04.yaml new file mode 100644 index 0000000..2af0297 --- /dev/null +++ b/data/Ubuntu-24.04.yaml @@ -0,0 +1,4 @@ +# Ubuntu-24.04.yaml --- Settings for Ubuntu-24.04 Noble +--- + +bind::checkzone_program: '/usr/bin/named-checkzone' diff --git a/metadata.json b/metadata.json index 82c7394..e794dad 100644 --- a/metadata.json +++ b/metadata.json @@ -29,7 +29,9 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "20.04" + "20.04", + "22.04", + "24.04" ] } ], diff --git a/spec/defines/zone/primary_spec.rb b/spec/defines/zone/primary_spec.rb index 4b5968e..720327e 100644 --- a/spec/defines/zone/primary_spec.rb +++ b/spec/defines/zone/primary_spec.rb @@ -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') @@ -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 @@ -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') @@ -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') @@ -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') @@ -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') @@ -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') @@ -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') @@ -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') @@ -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')