Mostrando las entradas con la etiqueta automation. Mostrar todas las entradas

Best and easy way to install puppet on SLES12

Based on the following question:

https://ask.puppetlabs.com/question/392/best-way-to-install-puppet-master-under-sles-suse-11-r2/

# zypper addrepo http://download.opensuse.org/repositories/systemsmanagement:/puppet/SLE_12/systemsmanagement:puppet.repo
# zypper refresh
# zypper install puppet

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`")
   end
end

Any core fact can be referenced with the colon and name of the fact
:operatingsystem
:osfamily
:kernel
etc.

Proper puppet variable declaration

The problem:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at ','; expected '}' 

Wrong variable declaration:

class repos::params {
      $baseurl = "foo",
      $baseurl_key = "ha",
      $sles12_baseurl = "doo",
      $sles12_SDK_baseurl = "ken",
}


Proper variable declaration:

class repos::params {
      $baseurl = "foo"
      $baseurl_key = "ha"
      $sles12_baseurl = "doo"
      $sles12_SDK_baseurl = "ken"
}