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. Trying 
with puppet apply (same with puppet agent -t on remote server) get the 
following output :

Notice: FACTER versionrepokubelocal value = 2
Notice: /Stage[main]/Kube::Config/Notify[FACTER versionrepokubelocal value 
= 2]/message: defined    'message' as 'FACTER versionrepokubelocal value = 
2'
Debug: /Stage[main]/Kube::Config/Notify[FACTER versionrepokubelocal value = 
2]: The container   Class[Kube::Config] will propagate my refresh event
Notice: Upgrading repository version
Notice: /Stage[main]/Kube::Config/Notify[Upgrading repository 
version]/message: defined 'message' as  'Upgrading repository version'
Before and after the execution I checked the value of the custom fact on 
the server and it is correctly valued as above :

[root@myserver manifests]$ facter versionrepokubelocal 2

I can't understand why it doesn't work correctly if the fact is correctly 
valued and the syntax of the statement is correct (tested with pdk validate 
and pdk test unit), it should not print "Upgrading repository version".

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/bdb372fb-59ff-4dc6-a521-0ca7eef67b05n%40googlegroups.com.

Reply via email to