Puppet Class: psick::profiles

Defined in:
manifests/profiles.pp

Summary

Manage profiles specific to nodes, roles or any other group

Overview

This class includes host/role specific profiles, they are applied after the base classes. Is exposes parameters that allow to define any class (from Psick, public modules or local profiles) to include as profile. For each different $facts value a differet entrypoint is exposed.

For each of these $facts_classes parameters, it’s expected an Hash of key-values: Keys can have any name, and are used as markers to allow overrides, exceptions management and customisations across Hiera’s hierarchies. Values are actual class names to include in the node’s catalog. They can be classes from psick module or any other module, both public ones (the typical component modules from the Forge) and private site profiles and modules.

Examples:

Manage common profiles classes for Linux and Windows:

psick::profiles::linux_classes:
  webserver: '::psick_profile::apache::tp'
psick::profiles::windows_classes:
  webserver: '::iis'

Disable inclusion of a class of the given marker. Here the

class marked as 'users' is set to an empty value and hence is
not included. Use this to manage exceptions and variations
overriding defaults set at more common Hiera layers.
  psick::profiles::linux_classes:
    'webserver': ''

Disable the whole class (no resource from this class is declared)

psick::profiles::manage: false

Parameters:

  • linux_classes (Psick::Class) (defaults to: {})

    Hash with the list of classes to include as added profiles when $facts is Linux. Of each key-value of the hash, the key is used as marker to eventually override across Hiera hierarchies and the value is the name of the class to actually include. Any key name can be used, but the value must be a valid class existing the the $modulepath. If the value is set to empty string (”) then the class of the relevant marker is not included.

  • windows_classes (Psick::Class) (defaults to: {})

    Hash with the list of classes to include as added profiles when $facts is windows.

  • solaris_classes (Psick::Class) (defaults to: {})

    Hash with the list of classes to include as added profiles when $facts is Solaris.

  • darwin_classes (Psick::Class) (defaults to: {})

    Hash with the list of classes to include as added profiles when $facts is Darwin.

  • manage (Boolean) (defaults to: $psick::manage)

    If to actually manage any resource in this class. If false no resource is managed. Default value is taken from main psick class.

  • noop_manage (Boolean) (defaults to: $psick::noop_manage)

    If to use the noop() function for all the resources provided by this class. If this is true the noop function is called with $noop_value argument. This overrides any other noop setting (either set on client’s puppet.conf or by noop() function in main psick class). Default from psick class.

  • noop_value (Boolean) (defaults to: $psick::noop_value)

    The value to pass to noop() function if noop_manage is true. It applies to all the resources (and classes) declared in this class If true: noop metaparamenter is set to true, resources are not applied If false: noop metaparameter is set to false, and any eventual noop setting is overridden: resources are always applied. Default from psick class.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'manifests/profiles.pp', line 59

class psick::profiles (

  Psick::Class $linux_classes   = {},
  Psick::Class $windows_classes = {},
  Psick::Class $darwin_classes  = {},
  Psick::Class $solaris_classes = {},

  Boolean $manage               = $psick::manage,
  Boolean $noop_manage          = $psick::noop_manage,
  Boolean $noop_value           = $psick::noop_value,
) {
  if $manage {
    if !empty($linux_classes) and $facts['kernel'] == 'Linux' {
      $linux_classes.each |$n,$c| {
        if $c != '' {
          contain $c
        }
      }
    }
    if !empty($windows_classes) and $facts['kernel'] == 'windows' {
      $windows_classes.each |$n,$c| {
        if $c != '' {
          contain $c
        }
      }
    }
    if !empty($darwin_classes) and $facts['kernel'] == 'Darwin' {
      $darwin_classes.each |$n,$c| {
        if $c != '' {
          contain $c
        }
      }
    }
    if !empty($solaris_classes) and $facts['kernel'] == 'Solaris' {
      $solaris_classes.each |$n,$c| {
        if $c != '' {
          contain $c
        }
      }
    }
  }
}