Puppet Class: psick::puppet::facter

Defined in:
manifests/puppet/facter.pp

Summary

A short summary of the purpose of this class

Overview

A description of what this class does

Examples:

include psick::puppet::facter

Parameters:

  • ensure (Psick::Ensure) (defaults to: 'present')
  • manage (Boolean) (defaults to: $psick::manage)
  • noop_manage (Boolean) (defaults to: $psick::noop_manage)
  • noop_value (Boolean) (defaults to: $psick::noop_value)
  • config_file_dir (String) (defaults to: '/etc/puppetlabs/facter')
  • config_file_template (String) (defaults to: 'psick/puppet/facter/facter.conf.epp')
  • cli_settings (Hash) (defaults to: {})
  • global_settings (Hash) (defaults to: {})
  • fact_groups (Hash) (defaults to: {})
  • blocklist (Array[String]) (defaults to: [])
  • ttls (Array[Hash]) (defaults to: [])


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
# File 'manifests/puppet/facter.pp', line 7

class psick::puppet::facter (
  Psick::Ensure $ensure        = 'present',
  Boolean $manage              = $psick::manage,
  Boolean $noop_manage         = $psick::noop_manage,
  Boolean $noop_value          = $psick::noop_value,
  String $config_file_dir      = '/etc/puppetlabs/facter',
  String $config_file_template = 'psick/puppet/facter/facter.conf.epp',
  Hash $cli_settings           = {},
  Hash $global_settings        = {},
  Hash $fact_groups            = {},
  Array[String] $blocklist     = [],
  Array[Hash] $ttls            = [],
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }
    $parameters = {
      cli_settings    => $cli_settings,
      global_settings => $global_settings,
      fact_groups     => $fact_groups,
      blocklist       => $blocklist,
      ttls            => $ttls,
    }
    if $cli_settings != {}
    or $global_settings != {}
    or $fact_groups != {}
    or $blocklist != []
    or $ttls != [] {
      psick::tools::create_dir { "psick::puppet::facter ${config_file_dir}":
        path   => $config_file_dir,
        before => File["${config_file_dir}/facter.conf"],
      }
      file { "${config_file_dir}/facter.conf":
        ensure  => $ensure,
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        content => psick::template($config_file_template,$parameters),
      }
    }
  }
}