Am 06.02.2014 13:13, schrieb Bas van Weelde:

> Administering a large number of hosts (100>) I am in need of a way to
> reboot them all at the same time or in groups. Just a reboot or after
> the change of a config file. Are there any pre-baked solutions for
> that, and if not, do you guyes have any experience in that? I am
> thinking of a way to check if there's a file existing that works as a
> trigger to exec the reboot.

You could use an "exec" resource which is subscribed to a file and has
"refreshonly => true", like:

class reboot ($reason = undef) {
    file { 'reboot_trigger':
        path => '/.reboot',
        ensure => present,
        content => "${reason}",
    }
    exec { 'reboot':
        command => "/sbin/shutdown -r now",
        subscribe => File['reboot_trigger'],
        refreshonly => true,
    }
}

Your agents will now reboot whenever you change $reason.

HTH...

    Dirk
-- 

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 1596666 (Ansage) 1149
*Email*: [email protected] <mailto:[email protected]>
*Skype*: dirk.heinrichs.recommind
www.recommind.com <http://www.recommind.com>



http://www.recommind.com

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/52F39D7C.7020502%40recommind.com.
For more options, visit https://groups.google.com/groups/opt_out.

<<inline: Logo.gif>>

Reply via email to