I have hit an issue when upgrading my code (written for 3.x) to live happily on our new 5.x puppet environment .. My question is specifically related to 'question mark conditionals' (not sure how else to describe them) ..
In the snippet below I have verified that the facter variable $operatingsystemmajrelease does resolve to 6 .. In version 3.x of puppet and below .. the 'notify' i have added at the end would return "six" (as expected).. but in puppet 4.x and above.. it drops down to the default "dont know" (therefore the comparison operator is not matching) ..I believe it has something to do with facter returning the value as a string , and I know puppet 4.x is a lot stricter with strings.. Ive tried quoting the conditionals '5', '6' etc ...but no joy ..does anyone know how I get around this to make this conditional work properly
$version = $operatingsystemmajrelease ? {
5 => 'five',
6 => 'six',
7 => 'seven',
default => 'dont know'
}
notify {"version is $version":}