Rebooting all agents simultaneously

23 views
Skip to first unread message

Bas van Weelde

unread,
Feb 6, 2014, 12:13:13 PM2/6/14
to puppet...@googlegroups.com
Goodday gentlemen,

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.

Any ideas?

Regards

Dirk Heinrichs

unread,
Feb 6, 2014, 2:34:36 PM2/6/14
to puppet...@googlegroups.com
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: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

Bas van Weelde

unread,
Feb 6, 2014, 3:26:40 PM2/6/14
to puppet...@googlegroups.com
Hi Dirk,
Thanks for that. With changing the variable $reason you mean to do that by a script or so. The issue is to perform the reboot by a simple 'click' as a matter of speaking, by giving a command from the prompt to change $reason.

Am I right?

Regards

Op donderdag 6 februari 2014 12:13:13 UTC schreef Bas van Weelde:

Bas van Weelde

unread,
Feb 6, 2014, 3:36:16 PM2/6/14
to puppet...@googlegroups.com
I also see that the trigger file is a hidden file: /.reboot. When I place that in /root's home this might be secure enough. What about a 'touch' of that file?

cheers


Op donderdag 6 februari 2014 12:13:13 UTC schreef Bas van Weelde:
Goodday gentlemen,
Reply all
Reply to author
Forward
0 new messages