3
0
Files
confdroid_prometheus/manifests/params.pp

69 lines
2.5 KiB
Puppet

# prometheus_cd::params.pp
# Module name: prometheus_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class holds all parameters for the prometheus_cd module.
# @param [String] reqpackage_prom the prometheus package
# @param [String] reqpackage_ne the node_exporter package
# @param [String] pkg_ensure which version of the package to install
# @param [boolean] manage_prometheus whether to manage prometheus
# @param [boolean] manage_node_exporter whether to manage node exporter
# @param [boolean] ps_manage_fw whether to manage the firewall
# @param [String] ps_prom_host the fqdn of the prometheus server
# @param [String] ps_fw_prefix the firewall rule prefix
# @param [String] ps_main_port the firewall main port for prometheus
# @param [String] ps_auth_user the username for authentication
# @param [String] ps_auth_pass the password for authentication
# @param [String] ps_web_pass the password for web authentication
# @param [String] ps_retention_time tsdb retention time
# @param [String] ps_retention_size tsdb retention size
##############################################################################
class prometheus_cd::params (
# installation
String $reqpackage_prom = 'prometheus2',
String $reqpackage_ne = 'node_exporter',
String $pkg_ensure = 'present',
# config logic
Boolean $manage_prometheus = false,
Boolean $manage_node_exporter = false,
Boolean $ps_manage_fw = false,
String $ps_prom_host = 'prometheus.example.net',
# firewall
String $ps_fw_prefix = '50',
String $ps_main_port = '9090',
# auth
String $ps_auth_user = 'changeme',
String $ps_auth_pass = 'changeme',
String $ps_web_pass = 'changeme',
# storage
String $ps_retention_time = '15d',
String $ps_retention_size = '20GB',
) {
# defaults
$fqdn = $facts['networking']['fqdn']
$domain = $facts['networking']['domain']
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
# dirs
$ps_main_dir = '/etc/prometheus'
$ps_system_file_dir = '/etc/systemd/system/prometheus.service.d'
# files
$ps_main_file = "${ps_main_dir}/prometheus.yml"
$ps_web_config_file = "${ps_main_dir}/web.yml"
$ps_system_service_file = "${ps_system_file_dir}/override.conf"
# services
$ps_prom_service = 'prometheus'
$ps_ne_service = 'node_exporter'
# includes must be last
include prometheus_cd::main::config
}