Last active
January 20, 2016 15:38
-
-
Save josy1024/6c6cf36ae55efc3cf561 to your computer and use it in GitHub Desktop.
puppet kernel update ensure latest an reboot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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