Skip to content

Instantly share code, notes, and snippets.

@josy1024
Last active January 20, 2016 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josy1024/6c6cf36ae55efc3cf561 to your computer and use it in GitHub Desktop.
Save josy1024/6c6cf36ae55efc3cf561 to your computer and use it in GitHub Desktop.
puppet kernel update ensure latest an reboot
#snipplet
package { "at" : ensure => installed }
case $virtual {
"xenu":
{
package { "kernel" :
name => "kernel-xen",
ensure => latest }
}
"hyperv":
{
package { "kernel" :
name => "kernel",
ensure => latest }
}
}
#initiate a reboot in one hour!
# check with: atq or atrm!
exec { "rebootme":
path => ['/usr/bin', '/usr/sbin', '/bin'],
command => '/bin/bash -c \'echo "/sbin/init 6" | /usr/bin/at now + 1 hour\'',
#command => '/bin/bash -c \'echo "/sbin/init 6" | /usr/bin/at 04:00\'',
subscribe => [ package["kernel"] ],
refreshonly => true,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment