Problem with Puppet manifest code
Hi,
I want to install linux-headers according to the kernels installed in the clients systems as there will be either "2.6.38-11-generic" or "2.6.38-11-generic-pae" kernel will exist in the client systems
so my requirement is that I want to install linux-headers as per the kernel below,
2.6.38-11-generic -----> linux-headers-2.6.38-11-generic
or
2.6.38-11-generic-pae ----> linux-headers-2.6.38-11-generic-pae
I written a manifest code as shown but only first kernel is getting install errespective of the kernel & not accepting the else statement as,
###############################################################
$kernel_version = "2.6.38-11-generic"
if $kernel_version == "$kernelrelease"
{
file { '"${kernelrelease}"/build':
path => '/lib/modules',
ensure => directory,
}
notice("In the if condition with kernel version ${kernelrelease}")
package { 'linux-headers-2.6.38-11-generic':
ensure => installed
}
}
else
{
file { '"${kernelrelease}"/build':
path => '/lib/modules',
ensure => directory,
}
package { 'linux-headers-2.6.38-11-generic-pae':
ensure => installed
}
notice("In the else condition with kernel version ${kernelrelease}")
}
so any one can assit me what is wrong with my above code.
Thanks
|