BTW, the exact intent is to allow to test the configuration file syntax
before reloading a service, and avoid reloading it with an invalid
state. Something as:

file { "/etc/openldap/slapd.conf":
content => template("slapd.conf.erb"),
notify => Service["slapd"]
}

service { "slapd":
ensure => "running",
onlyif => "/usr/sbin/slaptest"
}

Personally, I think this should be taken care of in the init script. But if you really want to do it from puppet I suppose you could override the start parameter of the service type...

To fail the resource if slaptest fails...

service { "slapd":
  ensure => "running",
  start  => "/usr/sbin/slaptest && service slapd start",
}

To continue silently but not start slapd....

service { "slapd":
  ensure => "running",
  start  => "( /usr/sbin/slaptest && service slapd start) || /bin/true",
}

But, IMO, a service init script should take care of its own pre-req's...

HTH
Craig


--
Craig Dunn | http://www.craigdunn.org
Yahoo/Skype: craigrdunn | Twitter: @crayfishX

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to