Run a custom fact based on core facts

So what if my previous example puppet custom fact easy as 1 2 3, needs to be run only on RedHat systems?

An additional line on the ruby file is added:

Facter.add('netuuid') do
   confine :operatingsystem => "RedHat"
   setcode do
      Facter::Core::Execution.exec("echo `grep UUID /etc/sysconfig/network-scripts/ifcfg-eth0 | cut -c 7-42`")

Any core fact can be referenced with the colon and name of the fact
Publicar un comentario

Entradas populares de este blog

Cómo tener un cultivo de búlgaros (Kéfir) por años

Jugando con la API de bitso: bitso-py

Mi primer ICO - WAX token