]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Try to restart only the affected stunnel
authorPeter Palfrader <peter@palfrader.org>
Fri, 27 May 2011 10:07:15 +0000 (12:07 +0200)
committerPeter Palfrader <peter@palfrader.org>
Fri, 27 May 2011 10:07:15 +0000 (12:07 +0200)
modules/stunnel4/manifests/init.pp

index fcedab8c3964dd960d997040d0406094e29d423c..897ea8303b446583075c3d6477cb6abf2ffc9725 100644 (file)
@@ -9,13 +9,25 @@ class stunnel4 {
                 ;
             "/etc/stunnel/puppet-${name}.conf":
                 content => template("stunnel4/stunnel.conf.erb"),
-                notify  => Exec['restart_stunnel'],
+                notify  => Exec["restart_stunnel_${name}"],
                 ;
             "/etc/init.d/stunnel4":
                 source => "puppet:///modules/stunnel4/etc-init.d-stunnel4",
                 mode    => 555,
             ;
         }
+        exec {
+            "restart_stunnel_${name}":
+                    command => "true && cd / && env -i /etc/init.d/stunnel4 restart ${name}",
+                    require => [ File['/etc/stunnel/stunnel.conf'],
+                                 File['/etc/init.d/stunnel4'],
+                                 Exec['enable_stunnel4'],
+                                 Exec['kill_file_override'],
+                                 Package['stunnel4']
+                               ],
+                    refreshonly => true,
+                    ;
+        }
     }
 
     # define an stunnel listener, listening for SSL connections on $accept,
@@ -54,7 +66,7 @@ class stunnel4 {
                 # source  => "puppet:///modules/exim/certs/${connecthost}.crt",
                 content => generate("/bin/cat", "/etc/puppet/modules/exim/files/certs/${connecthost}.crt",
                                                 "/etc/puppet/modules/exim/files/certs/ca.crt"),
-                notify  => Exec['restart_stunnel'],
+                notify  => Exec["restart_stunnel_${name}"],
                 ;
         }
         stunnel_generic {
@@ -86,16 +98,6 @@ class stunnel4 {
                 unless => "grep -q '^ENABLED=1' /etc/default/stunnel4",
                 require => [ Package['stunnel4'] ],
                 ;
-        "restart_stunnel":
-                command => "true && cd / && env -i /etc/init.d/stunnel4 restart",
-                require => [ File['/etc/stunnel/stunnel.conf'],
-                             File['/etc/init.d/stunnel4'],
-                             Exec['enable_stunnel4'],
-                             Exec['kill_file_override'],
-                             Package['stunnel4']
-                           ],
-                refreshonly => true,
-                ;
         "kill_file_override":
                 command => "sed -i -e 's/^FILES=/#&/' /etc/default/stunnel4",
                 onlyif => "grep -q '^FILES=' /etc/default/stunnel4",