I'm trying to have a exec dependency on a service object that would keep
it from being restarted if the exec fails.  Unfortunately, the service
gets refreshed regardless whenever the exec is run, failure or not.

I've tried various combinations of subscribe/require/notify, but can't
find an elegant way to not restart the service when the dependency
fails.  I must be missing something obvious.

We have a few needs for this model, here's a (simplified) example of one:

class dhcp::server {
    package { dhcp3-server: ensure => installed }

    service { dhcp3-server:
      ensure => running,
      hasstatus => true,
      require => [ Package["dhcp3-server"], Exec["check-dhcpd-conf"] ],
    }

    exec { "check-dhcpd-conf":
      command => "/usr/sbin/dhcpd3 -t 2>&1",
      refreshonly => true,
      subscribe => [ File["/etc/dhcp3/dhcpd.conf"], File["/etc/dhcp3"] ];
    }

    file {
      "/etc/dhcp3/dhcpd.conf":
        source => "puppet:///dist/dhcp/$hostname/dhcpd.conf";
      "/etc/dhcp3":
        source => "puppet:///dist/dhcp/include",
        recurse => true;
    }
}

Ideas?

-j


-- 
Jason Lavoie
Ratvarre sbe uver
ja...@oasys.net

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

Reply via email to