Monday 15 June 2015

How is the puppet osfamily core fact determined? -


I am working with Muppet 2.7.19 with factor 1.6.0 on SUS 11 Linux machine. The $ :: OSFamily factor variable is unset, though it has the $ :: operating system fact set:

  $ puppet apply - e ' Notify: "$ :: OS: / OS :: Operative System"}:} 'Notice: / SLS   

How is the $ :: OSFamily fact set is a puppet? I think it will be solved by upgrading to later versions of puppets, but it is difficult to upgrade on this Suse distribution.

An alternative solution is to set the factor variable globally (say in / etc / profile):

  $ export FACTER_OSFAMILY = $ $ / usr / bin / puppet Apply -E 'Notify {"$ :: osfamily / $ :: operating system}":' Notice: sauce / sls / code>  

Is this a better / cleaner to get set The way?

There was an approach here. Create a module inside your puppet tree, call it at my_facts (for example).

then my_osfamily.rb (fact) file to module / my_facts / lib / facter / my_osfamily.rb

  Facter.add ("my_osfamily") set code two os = Facter.value ('operatingsystem') Case OS   

Now assuming that you have / when Santa's. When "Ubuntu" "Debian" when "FreeBSD", "Freeshed" "Darwin" "OSX" is enabled on your puppet nodes, your custom facts should be automatically propagated and sent to you $: : My_osfamily should be able to use the facts as per the requirement.

Depending on the establishment of your environment, you can also use your facts:

  # Factor-P | Grep my_osfamily    

No comments:

Post a Comment