To resolve it we pulled the exec out of the equation and just set the service restart command to reload. Also set the Augeas require to point directly at the lens rather than the class.. but that may be optional. It was our first step.
# git diff
diff --git a/manifests/config.pp b/manifests/config.pp
index c8b45a7..897c5d8 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -69,7 +69,7 @@ class pgpool::config {
file { $pgpool_config_file:
ensure => $::pgpool::file_ensure,
- notify => Exec['pgpool_reload']
+ notify => Service['pgpool']
}
file { $pgpool_sysconfig_file:
@@ -79,17 +79,17 @@ class pgpool::config {
file { $pool_passwd_file:
ensure => $::pgpool::file_ensure,
- notify => Exec['pgpool_reload']
+ notify => Service['pgpool']
}
file { $pool_hba_file:
ensure => $::pgpool::file_ensure,
- notify => Exec['pgpool_reload']
+ notify => Service['pgpool']
}
file { $pcp_file:
ensure => $::pgpool::file_ensure,
- notify => Exec['pgpool_reload']
+ notify => Service['pgpool']
}
file { $log_dir:
diff --git a/manifests/config/val.pp b/manifests/config/val.pp
index 40100af..3488d9b 100644
--- a/manifests/config/val.pp
+++ b/manifests/config/val.pp
@@ -59,9 +59,8 @@ define pgpool::config::val (
Augeas {
incl => $target_real,
lens => 'Pgpool.lns',
- require => Class['pgpool::config'],
- notify => Exec['pgpool_reload'],
- before => Service['pgpool']
+ require => Augeas::Lens['pgpool'],
+ notify => Service['pgpool']
}
case $ensure_real {
diff --git a/manifests/hba.pp b/manifests/hba.pp
index f80c98e..a41715e 100644
--- a/manifests/hba.pp
+++ b/manifests/hba.pp
@@ -95,7 +95,6 @@ define pgpool::hba (
options => $options,
position => $position,
target => $target_real,
- notify => Exec['pgpool_reload'],
- before => Service['pgpool']
+ notify => Service['pgpool'],
}
}
diff --git a/manifests/service.pp b/manifests/service.pp
index fa09f6b..51e3ac2 100644
--- a/manifests/service.pp
+++ b/manifests/service.pp
@@ -36,22 +36,17 @@ class pgpool::service {
$pgpool_service_name = $::pgpool::service_name_real
- service { 'pgpool':
- ensure => $::pgpool::service_ensure_real,
- name => $pgpool_service_name,
- enable => $::pgpool::service_enable_real
- }
-
$exec_command_reload = $::osfamily ? {
/RedHat/ => '/usr/bin/pgpool reload',
/Debian/ => '/usr/sbin/pgpool reload',
default => '/usr/bin/pgpool reload',
}
-
- exec { 'pgpool_reload':
- command => $exec_command_reload,
- require => Service['pgpool'],
- refreshonly => true,
+ service { 'pgpool':
+ ensure => $::pgpool::service_ensure_real,
+ name => $::pgpool_service_name,
+ enable => $::pgpool::service_enable_real,
+ restart => $exec_command_reload,
}
+
}
Off v0.1.8 we ran into a dependency loop when setting
ensure => absentTo resolve it we pulled the exec out of the equation and just set the service restart command to reload. Also set the Augeas require to point directly at the lens rather than the class.. but that may be optional. It was our first step.