Skip to content

Drop code compatibility for non-systemd Red Hat #1518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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