Skip to content

Commit 9394cc9

Browse files
committed
(bug) reload the service after the deletion of old unit file
1 parent 4065ce2 commit 9394cc9

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

manifests/server/config.pp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,13 @@
224224
# - $datadir
225225
# - @extra_systemd_config
226226

227+
exec { 'restart-systemd':
228+
command => 'systemctl daemon-reload',
229+
refreshonly => true,
230+
path => '/bin:/usr/bin:/usr/local/bin',
231+
}
232+
227233
if (versioncmp($facts['puppetversion'], '6.1.0') < 0) {
228-
exec { 'restart-systemd':
229-
command => 'systemctl daemon-reload',
230-
refreshonly => true,
231-
path => '/bin:/usr/bin:/usr/local/bin',
232-
}
233234
$systemd_notify = [Exec['restart-systemd'], Class['postgresql::server::service']]
234235
}
235236
else {
@@ -256,12 +257,14 @@
256257
content => template('postgresql/systemd-override.erb'),
257258
require => File['systemd-conf-dir'],
258259
;
259-
260-
# Remove old unit file to avoid conflicts
261-
'old-systemd-override':
262-
ensure => absent,
263-
path => "/etc/systemd/system/${service_name}.service",
264-
;
265260
}
261+
262+
# Remove old unit file to avoid conflicts
263+
file {'old-systemd-override':
264+
ensure => absent,
265+
owner => root,
266+
group => root,
267+
path => "/etc/systemd/system/${service_name}.service",
268+
} -> Exec['restart-systemd'] -> Class['postgresql::server::service']
266269
}
267270
}

0 commit comments

Comments
 (0)