Even better, use versioncmp:
https://www.puppet.com/docs/puppet/8/function.html#versioncmp
On Wednesday, January 10, 2024 at 10:30:59 AM UTC-8 aru...@pixar.com wrote:
> If $facts['versionrepokubelocal'] is an integer I don't think your
> comparison will work. Try:
>
> ```
> if
If $facts['versionrepokubelocal'] is an integer I don't think your
comparison will work. Try:
```
if $facts['versionrepokubelocal'] != 2 {
notify { "Upgrading repository version": }type here
}
```
--
Aaron Russo (He/Him/His)
PIXAR | Lead Systems Engineer
On Wed, Jan 10, 2024 at 7:35 AM
The if statement doesn't work using a custom fact, i try this :
notify { "FACTER value= ${facts['versionrepokubelocal']}": }
if $facts['versionrepokubelocal'] != '2' {
notify { "Upgrading repository version": }type here
}
I use notify before "if" for to check the value of the custom fact.