Puppet Class: psick
- Defined in:
- manifests/init.pp
Overview
The main psick class. From here the whole infrastructure can be built. This class exposes parameters that serve as entry points to set general settings used by other psick profiles. When included, this class does nothing by default, but it’s required to be able to use PSICK for classification and/or to use any PSICK profile.
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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'manifests/init.pp', line 63
class psick (
# PSICK global vars
Boolean $manage = true,
Boolean $auto_prereq = true,
Psick::Autoconf $auto_conf = 'none',
Boolean $enable_firstrun = false,
Boolean $noop_mode = lookup('noop_mode', Boolean,'first',true),
# General network settings
Boolean $is_cluster = false,
Optional[Stdlib::Compat::Ip_address] $primary_ip = fact('networking.ip'),
Optional[String] $mgmt_interface = fact('networking.primary'),
Optional[String] $timezone = undef,
Hash $interfaces_hash = {},
# General endpoints and variables
Hash $settings = {},
Hash $servers = {},
Hash $tp = {},
Hash $firewall = {},
Hash $monitor = {},
Boolean $force_ordering = true,
) {
# Resource defaults for Tiny Puppet defines
Tp::Install {
cli_enable => $tp['cli_enable'],
test_enable => $tp['test_enable'],
puppi_enable => $tp['puppi_enable'],
debug => $tp['debug'],
data_module => $tp['data_module'],
}
Tp::Conf {
config_file_notify => $tp['config_file_notify'],
config_file_require => $tp['config_file_require'],
debug => $tp['debug'],
data_module => $tp['data_module'],
}
Tp::Dir {
config_dir_notify => $tp['config_dir_notify'],
config_dir_require => $tp['config_dir_require'],
debug => $tp['debug'],
data_module => $tp['data_module'],
}
# Building of the $::psick::interfaces variable, usable in any class included
# via or after psick.
# By default are set main and mgmt interfaces based on sane facts values and
# user params $primary_ip and $mgmt_interface
$primary_interface = $facts['networking']['primary']
$interfaces_default = {
main => {
interface => $facts['networking']['primary'],
address => pick($primary_ip, $facts['networking']['interfaces'][$primary_interface]['ip']),
netmask => $facts['networking']['interfaces'][$primary_interface]['netmask'],
network => $facts['networking']['interfaces'][$primary_interface]['network'],
hostname => $facts['networking']['fqdn'],
},
mgmt => {
interface => $mgmt_interface,
address => $facts['networking']['interfaces'][$mgmt_interface]['ip'],
netmask => $facts['networking']['interfaces'][$mgmt_interface]['netmask'],
network => $facts['networking']['interfaces'][$mgmt_interface]['network'],
hostname => $facts['networking']['fqdn'],
}
}
$interfaces = deep_merge($interfaces_default, $interfaces_hash)
# PSICK PRE, BASE CLASSES AND PROFILES + OPTIONAL FIRSTRUN MODE
# The classes included here manage PSICK classification and
# relevant class ordering
if $facts['firstrun'] == 'done' or $enable_firstrun == false {
contain ::psick::pre
contain ::psick::base
contain ::psick::profiles
if $force_ordering {
Class['psick::pre'] -> Class['psick::base'] -> Class['psick::profiles']
}
} else {
contain ::psick::firstrun
notify { "This catalog should be applied only at the first Puppen run\n": }
}
}
|