facts is not a hash or array when accessing it with os at

asked 2017-10-19 17:32:18 -0600

esxi1979 gravatar image

hello all

cat fact_if.pp

if $facts['os']['selinux']['enabled'] {
  notice('SELinux is enabled')
} else {
  notice('SELinux is disabled')
}

i tried

puppet apply fact_if.pp

also

puppet apply factif.pp --no-stringifyfacts

i get err

Error: facts is not a hash or array when accessing it with os at /root/puppet/puppet/manifests/fact_if.pp:1 on node server

i am using

puppet --version 3.8.7

pls suggest, thanks

edit retag flag offensive close merge delete

Comments

Yeah and `facter --version` probably reports something with `2.x`. So you have to look at https://docs.puppet.com/facter/2.4/core_facts.html to retrieve documentation about the facts you're using.

Kai Burghardt gravatar imageKai Burghardt ( 2017-10-20 08:55:38 -0600 )edit