remove pre-bookworm legacy code in Puppet
We have a bunch of code in our puppet codebase that checks for pre-bullseye releases. Remove that code when we finish upgrading to bullseye.
an example:
modified modules/profile/manifests/prometheus/bind_exporter.pp
@@ -4,6 +4,14 @@ class profile::prometheus::bind_exporter(
) {
$package_ensure = $ensure ? { 'present' => 'installed', 'absent' => 'absent' }
$service_ensure = $ensure ? { 'present' => 'running', 'absent' => 'stopped' }
+
+ # this should be dropped when bind exporter is upgraded to 0.3.0
+ # or later (BULLSEYE) everywhere
+ if versioncmp($facts['os']['release']['major'], '11') >= 0 {
+ $extra_options = ''
+ } else {
+ $extra_options = "-bind.pid-file /var/run/named/named.pid -bind.stats-groups 'server,view,tasks'"
+ }
class { 'prometheus::bind_exporter':
package_ensure => $package_ensure,
service_ensure => $service_ensure,
@@ -17,8 +25,10 @@ class profile::prometheus::bind_exporter(
package_name => 'prometheus-bind-exporter',
service_name => 'prometheus-bind-exporter',
# purge_config_dir => true,
- # should be dropped when bind exporter is upgraded to 0.3.0 or later (BULLSEYE)
- extra_options => "-bind.pid-file /var/run/named/named.pid -bind.stats-groups 'server,view,tasks'",
+
+ # this should be dropped when bind exporter is upgraded to 0.3.0
+ # or later (BULLSEYE) everywhere
+ extra_options => $extra_options,
}
# realize the allow rules defined on the prometheus server(s)
in the above code, we're remove first if
block, and the extra_options =>
class parameter passed to prometheus::bind_exporter
completely.
but in general, grep for:
-
buster
(case-insensitive) -
bullseye
(case-insensitive) -
bookworm
(case-insentitive) -
versioncmp
-
lsbmajdistrelease
-
lsbdistcodename
Edited by anarcat