Ubuntu/vidid and newer use systemd

This commit is contained in:
Michael Moll 2016-02-20 19:55:19 +01:00
parent 76321c78e4
commit ef94a2c51d
2 changed files with 7 additions and 5 deletions

View file

@ -88,12 +88,11 @@ class postgresql::globals (
default => undef,
},
'Ubuntu' => $::operatingsystemrelease ? {
/^(15.10)$/ => '9.4',
/^(15.04)$/ => '9.4',
/^(14.10)$/ => '9.4',
/^(14.04)$/ => '9.3',
/^(11.10|12.04|12.10|13.04|13.10)$/ => '9.1',
/^(10.04|10.10|11.04)$/ => '8.4',
/^(11.10|12.04|12.10|13.04|13.10)$/ => '9.1',
/^(14.04)$/ => '9.3',
/^(14.10|15.04|15.10)$/ => '9.4',
/^(16.04)$/ => '9.5',
default => undef,
},
default => undef,

View file

@ -159,6 +159,9 @@ class postgresql::params inherits postgresql::globals {
if $::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '8.0') >= 0 {
# Jessie uses systemd
$service_status = pick($service_status, "/usr/sbin/service ${service_name}@*-main status")
} elsif $::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '15.04') >= 0 {
# Ubuntu releases since vivid use systemd
$service_status = pick($service_status, "/usr/sbin/service ${service_name} status")
} else {
$service_status = pick($service_status, "/etc/init.d/${service_name} status | /bin/egrep -q 'Running clusters: .+|online'")
}