Hello all,
I've been trying to solve what seems to be a simple problem but have yet to
find the answer.
I'm trying to do a comparison between the value of a fact and some
arbitrary value:
if ($::class == 'workstation') and ($::kernelmajversion <= '3.11') {
notify {"My Kernel version is <= ${kernel_test_version} and I'm going
to upgrade" : }
file {
"/usr/src/linux-headers-${kernel_test_version}_${kernel_release_test_version}~precise1_all.deb"
:
mode => '755',
ensure => 'present',
source =>
"puppet:///modules/kernel/${kernel_test_version}_${kernel_release_test_version}~precise1_all.deb"
}
}
elsif ($::class == 'workstation') and ($::kernelmajversion >= '3.11') {
notify {"My Kernel version is >= ${kernel_test_version} so I don't need
to upgrade": }
}
After invoking a puppet run, I can never get the evaluation of "if" to
actually take place and as a result, the elsif is invoked and regardless of
whether or not the kernel version is <= 3.11, the "if" statement is never
run. From what I gather, this means that the evaluation of "if" is never
happening and the resulting elsif is automatically invoked.
I've also seen some errors that pertain to string/float comparisons and to
my knowledge, facter data is coming back as a string and my version number
in the "if" statement (3.11) is a float and therefore can't be compared due
to comparison rules of different data types.
Does anybody have some words of wisdom that may lead me to the correct
syntax for what I'm trying to achieve?
Thanks in advance to the community for the help.
Cheers,
Mike
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/5f9249a2-1bab-4f7e-84b5-f5fa6afd3ad7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.