Merge pull request #677 from cavaliercoder/master

(MODULES-2211) Fixed systemd-override for RedHat systems with unmanaged Yum repos
This commit is contained in:
David Schmitt 2015-09-01 08:06:43 +01:00
commit e42d787141
2 changed files with 3 additions and 6 deletions

View file

@ -20,6 +20,7 @@ class postgresql::server::config {
$manage_recovery_conf = $postgresql::server::manage_recovery_conf
$datadir = $postgresql::server::datadir
$logdir = $postgresql::server::logdir
$service_name = $postgresql::server::service_name
if ($manage_pg_hba_conf == true) {
# Prepare the main pg_hba file
@ -163,7 +164,7 @@ class postgresql::server::config {
if $::operatingsystemrelease =~ /^7/ or $::operatingsystem == 'Fedora' {
file { 'systemd-override':
ensure => present,
path => "/etc/systemd/system/${postgresql::params::service_name}.service",
path => "/etc/systemd/system/${service_name}.service",
owner => root,
group => root,
content => template('postgresql/systemd-override.erb'),

View file

@ -1,8 +1,4 @@
<% if @manage_package_repo and (scope.function_versioncmp([@version.to_s, '9.1']) >= 0) -%>
.include /lib/systemd/system/postgresql-<%= @version %>.service
<% else -%>
.include /lib/systemd/system/postgresql.service
<% end -%>
.include /lib/systemd/system/<%= @service_name %>.service
[Service]
Environment=PGPORT=<%= @port %>
Environment=PGDATA=<%= @datadir %>