Created
August 2, 2011 16:19
-
-
Save gondoi/1120554 to your computer and use it in GitHub Desktop.
grab kernel version
This file contains hidden or 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
| default[:kernel][:newinstall] = "default" |
This file contains hidden or 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
| package "kernel-xen" | |
| log("Detected kernel installed: #{node[:kernel][:newinstall]}") { level :debug } | |
| ruby_block "find_installed_kernel_ver" do | |
| block do | |
| node.set[:kernel][:newinstall] = %x[cd /boot && ls -t vmlinuz*].split('vmlinuz-')[1].strip | |
| Chef::Log.debug("#{node[:kernel][:newinstall]}") | |
| end | |
| end | |
| log("Detected kernel installed: #{node[:kernel][:newinstall]}") { level :debug } | |
| template "/boot/grub/grub.conf" do | |
| source "grub.conf.erb" | |
| end |
This file contains hidden or 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
| default=0 | |
| timeout=5 | |
| title=<%= node[:platform] %> (<%= node[:kernel][:newinstall] %>) | |
| root (hd0) | |
| kernel /boot/vmlinuz-<%= node[:kernel][:newinstall] %> ro console=hvc0 root=/dev/xvda1 | |
| initrd /boot/initrd-<%= node[:kernel][:newinstall] %>.img |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment