Puppet Class: nut
- Inherits:
- nut::params
- Defined in:
- manifests/init.pp
Overview
Installs Network UPS Tools (NUT).
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 150 151 |
# File 'manifests/init.pp', line 65
class nut (
Optional[Stdlib::Absolutepath] $certfile = undef,
Optional[Tuple[String, String]] $certident = undef,
Optional[Stdlib::Absolutepath] $certpath = undef,
Optional[Enum['no', 'request', 'require']] $certrequest = undef,
Optional[Tuple[String, String]] $client_certident = undef,
Optional[Stdlib::Absolutepath] $client_certpath = undef,
Optional[Boolean] $client_certverify = undef,
Optional[Stdlib::Absolutepath] $client_cmdscript = undef,
Optional[Integer[0]] $client_deadtime = undef,
Optional[Integer[0]] $client_finaldelay = undef,
Optional[Boolean] $client_forcessl = undef,
Optional[Integer[0]] $client_hostsync = undef,
Boolean $client_manage_package = $::nut::params::client_manage_package,
Boolean $client_manage_service = $::nut::params::client_manage_service,
Integer[1] $client_minsupplies = 1,
Optional[Integer[0]] $client_nocommwarntime = undef,
Boolean $client_use_upssched = false,
Optional[Stdlib::Absolutepath] $client_notifycmd = $client_use_upssched ? {
true => $::nut::params::upssched, # lint:ignore:parameter_order
default => undef,
},
Optional[Hash[Nut::Event, Tuple[Boolean, 3, 3]]] $client_notifyflag = undef,
Optional[Hash[Nut::Event, String]] $client_notifymsg = undef,
String $client_package_name = $::nut::params::client_package_name,
Optional[Integer[0]] $client_pollfreq = undef,
Optional[Integer[0]] $client_pollfreqalert = undef,
Optional[Integer[0]] $client_rbwarntime = undef,
String $client_service_name = $::nut::params::client_service_name,
String $client_shutdowncmd = $::nut::params::shutdown_command,
Stdlib::Absolutepath $conf_dir = $::nut::params::conf_dir,
Hash[String, String] $driver_packages = $::nut::params::driver_packages,
String $group = $::nut::params::group,
Optional[Array[Nut::Listen, 1]] $listen = undef,
Optional[Integer[1]] $maxage = undef,
Optional[Integer[1]] $maxconn = undef,
String $package_name = $::nut::params::server_package_name,
String $service_name = $::nut::params::server_service_name,
Stdlib::Absolutepath $statepath = $::nut::params::state_dir,
String $user = $::nut::params::user,
) inherits nut::params {
contain nut::install
contain nut::config
contain nut::service
class { 'nut::common':
certident => $client_certident,
certpath => $client_certpath,
certverify => $client_certverify,
cmdscript => $client_cmdscript,
conf_dir => $conf_dir,
deadtime => $client_deadtime,
finaldelay => $client_finaldelay,
forcessl => $client_forcessl,
group => $group,
hostsync => $client_hostsync,
manage_package => $client_manage_package,
manage_service => $client_manage_service,
minsupplies => $client_minsupplies,
nocommwarntime => $client_nocommwarntime,
notifycmd => $client_notifycmd,
notifyflag => $client_notifyflag,
notifymsg => $client_notifymsg,
package_name => $client_package_name,
pollfreq => $client_pollfreq,
pollfreqalert => $client_pollfreqalert,
rbwarntime => $client_rbwarntime,
service_name => $client_service_name,
shutdowncmd => $client_shutdowncmd,
state_dir => $statepath,
use_upssched => $client_use_upssched,
user => $user,
}
Class['nut::install'] -> Class['nut::config'] ~> Class['nut::service']
if $client_manage_service {
# If the client manages its own service then the client should depend on
# the server being up
Class['nut::service'] -> Class['nut::common']
} else {
# If the server service starts everything up then we need to have the
# client configured before the service starts
Class['nut::config'] -> Class['nut::common'] ~> Class['nut::service']
}
}
|