Defined Type: nut::ups
- Defined in:
- manifests/ups.pp
Overview
Adds and configures a UPS.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'manifests/ups.pp', line 17
define nut::ups (
String $driver,
Variant[Integer[0, 65535], String] $port,
Hash[String, Any] $extra = {},
String $ups = $title,
) {
if ! defined(Class['nut']) {
fail('You must include the nut base class before using any nut defined resources')
}
::concat::fragment { "nut ups ${ups}":
content => template("${module_name}/ups.conf.erb"),
target => "${::nut::conf_dir}/ups.conf",
}
# Handle SNMP or XML UPS drivers
if has_key($::nut::driver_packages, $driver) {
ensure_packages([$::nut::driver_packages[$driver]])
Package[$::nut::driver_packages[$driver]]
-> ::Concat::Fragment["nut ups ${ups}"]
}
}
|