Skip to content

Commit

Permalink
Merge pull request #1518 from ekohl/drop-non-systemd-red-hat
Browse files Browse the repository at this point in the history
Drop code compatibility for non-systemd Red Hat
  • Loading branch information
bastelfreak committed Sep 26, 2023
2 parents 4767340 + 70130eb commit 3520635
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
9 changes: 2 additions & 7 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,8 @@
$postgresql_conf_mode = pick($postgresql_conf_mode, '0600')
}

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, "${bindir}/psql")

Expand Down
7 changes: 2 additions & 5 deletions manifests/server/instance/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,8 @@
notify => Class['postgresql::server::reload'],
}
}
# lint:ignore:140chars
# RHEL 7 and 8 both support drop-in files for systemd units. Gentoo also supports drop-in files.
# Edit 02/2023 RHEL basedc Systems and Gentoo need Variables set for $PGPORT, $DATA_DIR or $PGDATA, thats what the drop-in file is for.
# lint:endignore:140chars
if $facts['os']['family'] in ['RedHat', 'Gentoo'] and $facts['service_provider'] == 'systemd' {
# RHEL based systems and Gentoo need variables set for $PGPORT, $DATA_DIR or $PGDATA via a drop-in file
if $facts['os']['family'] == 'RedHat' or ($facts['os']['family'] == 'Gentoo' and $facts['service_provider'] == 'systemd') {
postgresql::server::instance::systemd { $service_name:
port => $port,
datadir => $datadir,
Expand Down

0 comments on commit 3520635

Please sign in to comment.