Additional puppet notes after books and presentation

At some point, I’m going to have to consolidate all the notes into one document; but, just to keep the new shit segregted from the old shit...

Taking the free puppet courses available at https://puppetlabs.com/learn/library

Classes:

Just ran through the exercise. Interestingly, didn’t have to create a site.pp file. Just include the module at the end of the module definition:

class motd {
  file { '/etc/motd':
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    content => 'Hellow, world!  Puppet is AWESOME!!',
  }
}
include motd

Then run puppet apply motd.pp and it works...

Autoloading:

${module}->lib directory contains custom facts and custom resource types?

$confdir =

  • /etc/puppet (open source)
  • /etc/puppetlabs (puppet enterprise)

puppet config print modulepath to display the modulepath.

autoloading = puppet run, -> catalog compile -> find/compile the modules.

Relationship:

before: Causes a resource to be applied before the target resource

require: Causes a resource to be applied after the target resource

notify: Causes the notified resource to refresh if the notifying resource changes

subscribe: subscribing resource will refresh if the target resource changes.

chto gets applied first:

class chto {
    before => some_other
}

chto gets applied after:

chass chto {
    require => some_other
}

Hiera:

Hiera is for providing config data in the form of variables

ENCs are for providing node configuration.

Facter IDs system information such as OS, IP, etc. Sends facts to puppet