Puppet Class: psick::puppet

Defined in:
manifests/puppet.pp

Overview

Parameters:

  • agent_class (Optional[String]) (defaults to: undef)
  • server_class (String) (defaults to: '')
  • puppetdb_class (String) (defaults to: '')
  • modules (Array) (defaults to: [])
  • module_user (String) (defaults to: 'root')
  • external_facts (Hash) (defaults to: {})
  • facts_file_path (String) (defaults to: '')
  • facts_file_exclude_regex (Regexp) (defaults to: /^(.*uptime.*|system_uptime|_timestamp|memoryfree.*|swapfree.*|puppet_inventory_metadata|last_run.*|load_averages.*|memory.*|mountpoints.*|physical_volumes.*|volume_groups.*)$/)
  • manage (Boolean) (defaults to: $psick::manage)
  • noop_manage (Boolean) (defaults to: $psick::noop_manage)
  • noop_value (Boolean) (defaults to: $psick::noop_value)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'manifests/puppet.pp', line 2

class psick::puppet (

  Optional[String] $agent_class     = undef,
  String           $server_class    = '', # lint:ignore:params_empty_string_assignment
  String           $puppetdb_class  = '', # lint:ignore:params_empty_string_assignment

  Array $modules                    = [],
  String $module_user               = 'root',

  Hash             $external_facts  = {},

  String           $facts_file_path = '', # lint:ignore:params_empty_string_assignment
  Regexp           $facts_file_exclude_regex = /^(.*uptime.*|system_uptime|_timestamp|memoryfree.*|swapfree.*|puppet_inventory_metadata|last_run.*|load_averages.*|memory.*|mountpoints.*|physical_volumes.*|volume_groups.*)$/, # lint:ignore:140chars

  Boolean          $manage               = $psick::manage,
  Boolean          $noop_manage          = $psick::noop_manage,
  Boolean          $noop_value           = $psick::noop_value,
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }
    if $facts['pe_concat_basedir'] == '/opt/puppetlabs/puppet/cache/pe_concat' {
      $real_agent_class = pick($agent_class, '::psick::puppet::pe_agent')
    } else {
      $real_agent_class = pick($agent_class, '::psick::puppet::osp_agent')
    }

    if $agent_class != '' {
      include $real_agent_class
    }
    if $server_class != '' {
      include $server_class
    }
    if $puppetdb_class != '' {
      include $puppetdb_class
    }

    $external_facts.each | $k , $v | {
      psick::puppet::set_external_fact { $k:
        * => $v,
      }
    }

    if $facts_file_path != '' {
      file { $facts_file_path:
        content => template('psick/puppet/facts.yaml.erb'),
      }
    }

    $modules.each | $mod | {
      psick::puppet::module { $mod:
        user   => $module_user,
      }
    }
  }
}