Skip to content

Commit

Permalink
Drop code for linux without systemd
Browse files Browse the repository at this point in the history
FreeBSD 9.4/9.5 are EoL since ages and not listed as supported in
metadata.json. Also no linux operating system without Systemd is
supported, so we can drop the old code.
  • Loading branch information
bastelfreak committed Sep 27, 2023
1 parent e5a28a0 commit 97d2c66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
19 changes: 3 additions & 16 deletions manifests/params.pp
Expand Up @@ -97,15 +97,7 @@
$python_package_name = pick($python_package_name, 'python-psycopg2')
}

if $postgresql::globals::postgis_package_name {
$postgis_package_name = $postgresql::globals::postgis_package_name
} elsif $facts['os']['release']['major'] == '5' {
$postgis_package_name = 'postgis'
} elsif $postgis_version and versioncmp($postgis_version, '2') < 0 {
$postgis_package_name = "postgis${package_version}"
} else {
$postgis_package_name = "postgis2_${package_version}"
}
$postgis_package_name = pick($postgresql::globals::postgis_package_name, "postgis2_${package_version}")
}

'Archlinux': {
Expand Down Expand Up @@ -164,13 +156,8 @@
$bindir = pick($bindir, "/usr/lib/postgresql/${version}/bin")
$datadir = pick($datadir, "/var/lib/postgresql/${version}/main")
$confdir = pick($confdir, "/etc/postgresql/${version}/main")
if pick($service_provider, $facts['service_provider']) == 'systemd' {
$service_reload = "systemctl reload ${service_name}"
$service_status = pick($service_status, "systemctl status ${service_name}")
} else {
$service_reload = "service ${service_name} reload"
$service_status = pick($service_status, "service ${service_name} status")
}
$service_reload = "systemctl reload ${service_name}"
$service_status = pick($service_status, "systemctl status ${service_name}")
$psql_path = pick($psql_path, '/usr/bin/psql')
$postgresql_conf_mode = pick($postgresql_conf_mode, '0644')
}
Expand Down
6 changes: 1 addition & 5 deletions spec/spec_helper_local.rb
Expand Up @@ -155,7 +155,7 @@ def param(type, title, param)
# See https://github.com/voxpupuli/voxpupuli-test/blob/master/lib/voxpupuli/test/facts.rb
add_custom_fact :service_provider, ->(_os, facts) do
case facts[:osfamily].downcase
when 'archlinux', 'debian'
when 'archlinux', 'debian', 'redhat', 'suse'
'systemd'
when 'darwin'
'launchd'
Expand All @@ -165,10 +165,6 @@ def param(type, title, param)
'openrc'
when 'openbsd'
'openbsd'
when 'redhat'
(facts[:operatingsystemrelease].to_i >= 7) ? 'systemd' : 'redhat'
when 'suse'
(facts[:operatingsystemmajrelease].to_i >= 12) ? 'systemd' : 'redhat'
when 'windows'
'windows'
else
Expand Down

0 comments on commit 97d2c66

Please sign in to comment.