Files
confdroid_automatic/manifests/params.pp

58 lines
2.4 KiB
Puppet

## confdroid_automatic::params.pp
# Module name: confdroid_automatic
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages all parameters for the confdroid_automatic module
# @param [String] ac_reqpackages which packages to install
# @param [String] ac_pkg_ensure which version of packages to install
# @param [String] ac_upgrade_type what upgrades to manage. Can be
# 'default', 'security', 'minimal' or 'all'
# @param [String] ac_random_sleep random sleep seconds
# @param [String] ac_network_online_timeout Maximum time until be online
# @param [String] ac_download_updates whether to download available updates
# @param [String] ac_apply_updates whether to apply available updates
# @param [String] ac_reboot when to reboot after applied updates
# @param [String] ac_emit_via how to inform about emitted updates
# @param [String] ac_email_to where to send the email to
# @param [String] ac_email_host which host to use to send the email
# @param [Variant[String,Array[String]]] ac_excludepkgs packages to exclude from updates
##############################################################################
class confdroid_automatic::params (
String $ac_reqpackages = 'dnf-automatic',
String $ac_pkg_ensure = 'latest',
Variant[String, Array[String]] $ac_excludepkgs = [],
# updates
String $ac_upgrade_type = 'default',
String $ac_random_sleep = '0',
String $ac_network_online_timeout = '60',
String $ac_download_updates = 'yes',
String $ac_apply_updates = 'yes',
String $ac_reboot = 'never',
String $ac_emit_via = 'email',
String $ac_email_to = 'root@example.net',
String $ac_email_host = 'localhost',
) {
# Facts
$fqdn = $facts['networking']['fqdn']
$domain = $facts['networking']['domain']
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
# Service
$ac_service = 'dnf-automatic.timer'
# Files
$ac_main_config = '/etc/dnf/automatic.conf'
$ac_main_config_erb = 'confdroid_automatic/automatic.conf.erb'
$ac_excludepkgs_normalized = $ac_excludepkgs ? {
Array => join($ac_excludepkgs, ','),
default => $ac_excludepkgs,
}
# includes must be last
include confdroid_automatic::main::config
}