diff --git a/manifests/firewall/iptables.pp b/manifests/firewall/iptables.pp index 4eae707..9c3b803 100644 --- a/manifests/firewall/iptables.pp +++ b/manifests/firewall/iptables.pp @@ -1,6 +1,6 @@ # confdroid_prometheus::firewall::iptables.pp # Module name: confdroid_prometheus -# Author: Arne Teuke (arne_teuke@confdroid.com) +# Author: 12ww1160 (12ww1160@confdroid.com) # @summary Class manages the firewall rules for the confdroid_prometheus module. ############################################################################## class confdroid_prometheus::firewall::iptables ( diff --git a/manifests/init.pp b/manifests/init.pp index 2d0e277..f320e43 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,6 +1,6 @@ # confdroid_prometheus::init.pp # Module name: confdroid_prometheus -# Author: Arne Teuke (arne_teuke@confdroid.com) +# Author: 12ww1160 (12ww1160@confdroid.com) # @summary Class initializes the confdroid_prometheus module. ############################################################################## class confdroid_prometheus { diff --git a/manifests/main/config.pp b/manifests/main/config.pp index 1d0ffe5..e3f19f6 100644 --- a/manifests/main/config.pp +++ b/manifests/main/config.pp @@ -1,6 +1,6 @@ # confdroid_prometheus::main::config.pp # Module name: confdroid_prometheus -# Author: Arne Teuke (arne_teuke@confdroid.com) +# Author: 12ww1160 (12ww1160@confdroid.com) # @summary Class manages the module logic for the confdroid_prometheus module. ############################################################################## class confdroid_prometheus::main::config ( diff --git a/manifests/main/dirs.pp b/manifests/main/dirs.pp index 4a23602..3ffb3f6 100644 --- a/manifests/main/dirs.pp +++ b/manifests/main/dirs.pp @@ -1,6 +1,6 @@ # confdroid_prometheus::main::dirs.pp # Module name: confdroid_prometheus -# Author: Arne Teuke (arne_teuke@confdroid.com) +# Author: 12ww1160 (12ww1160@confdroid.com) # @summary Class manages directories for the confdroid_prometheus module. ############################################################################## class confdroid_prometheus::main::dirs ( @@ -43,7 +43,20 @@ class confdroid_prometheus::main::dirs ( } if $ps_enable_pruning == false { file { $ps_pruning_dir: - ensure => absent, + ensure => absent, + } + } + # binary install directory + if $install_from_binary == true { + file { $ps_install_dir: + ensure => directory, + owner => 'root', + group => 'root', + mode => '0755', + selrange => s0, + selrole => object_r, + seltype => usr_, + seluser => unconfined_u, } } } diff --git a/manifests/main/files.pp b/manifests/main/files.pp index 814d849..93abb76 100644 --- a/manifests/main/files.pp +++ b/manifests/main/files.pp @@ -1,6 +1,6 @@ # confdroid_prometheus::main::files.pp # Module name: confdroid_prometheus -# Author: Arne Teuke (arne_teuke@confdroid.com) +# Author: 12ww1160 (12ww1160@confdroid.com) # @summary Class manages configuration files for the confdroid_prometheus module. ############################################################################## class confdroid_prometheus::main::files ( diff --git a/manifests/main/install.pp b/manifests/main/install.pp index ef3b344..fb6a8c9 100644 --- a/manifests/main/install.pp +++ b/manifests/main/install.pp @@ -1,16 +1,22 @@ # confdroid_prometheus::main::install.pp # Module name: confdroid_prometheus -# Author: Arne Teuke (arne_teuke@confdroid.com) +# Author: 12ww1160 (12ww1160@confdroid.com) # @summary Class install binaries for the confdroid_prometheus module. ############################################################################## class confdroid_prometheus::main::install ( ) inherits confdroid_prometheus::params { require confdroid_prometheus::main::yumrepo if $manage_prometheus == true { - package { $reqpackage_prom: - ensure => $pkg_ensure, + if $install_from_binary == false { + package { $reqpackage_prom: + ensure => $pkg_ensure, + } + } + if $install_from_binary == true { + # place function here to install from binary releases, e.g. using the archive module } } + if $manage_node_exporter == true { package { $reqpackage_ne: ensure => $pkg_ensure, diff --git a/manifests/main/service.pp b/manifests/main/service.pp index 60eaeba..f74ddb4 100644 --- a/manifests/main/service.pp +++ b/manifests/main/service.pp @@ -1,6 +1,6 @@ # confdroid_prometheus::main::service.pp # Module name: confdroid_prometheus -# Author: Arne Teuke (arne_teuke@confdroid.com) +# Author: 12ww1160 (12ww1160@confdroid.com) # @summary Class manages the services for the confdroid_prometheus module. ############################################################################## class confdroid_prometheus::main::service ( diff --git a/manifests/main/yumrepo.pp b/manifests/main/yumrepo.pp index 90d2acc..3e95bca 100644 --- a/manifests/main/yumrepo.pp +++ b/manifests/main/yumrepo.pp @@ -1,6 +1,6 @@ # confdroid_prometheus::main::yumrepo.pp # Module name: confdroid_prometheus -# Author: Arne Teuke (arne_teuke@confdroid.com) +# Author: 12ww1160 (12ww1160@confdroid.com) # @summary Class manages yumrepo for the confdroid_prometheus module. ############################################################################## class confdroid_prometheus::main::yumrepo ( diff --git a/manifests/params.pp b/manifests/params.pp index 5740480..0ccdbd6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,6 +1,6 @@ # confdroid_prometheus::params.pp # Module name: confdroid_prometheus -# Author: Arne Teuke (arne_teuke@confdroid.com) +# Author: 12ww1160 (12ww1160@confdroid.com) # @summary Class holds all parameters for the confdroid_prometheus module. # @param [String] reqpackage_prom the prometheus package # @param [String] reqpackage_ne the node_exporter package @@ -41,6 +41,8 @@ # @param [String] ps_min_age_hours Minimum block age in hours before pruning # @param [String] ps_grace_hours Grace period in hours to be extra safe # @param [String] ps_sql_template the SQL template to use for checks. +# @param [Boolean] install_from_binary whether to install from binary releases +# instead of packages ############################################################################## class confdroid_prometheus::params ( @@ -48,6 +50,7 @@ class confdroid_prometheus::params ( String $reqpackage_prom = 'prometheus2', String $reqpackage_ne = 'node_exporter', String $pkg_ensure = 'present', + Boolean $install_from_binary = false, # config logic Boolean $manage_prometheus = false, @@ -112,6 +115,7 @@ class confdroid_prometheus::params ( $ps_main_dir = '/etc/prometheus' $ps_system_file_dir = '/etc/systemd/system/prometheus.service.d' $ps_system_dir = '/etc/systemd/system/' + $ps_install_dir = '/opt/prometheus' # files $ps_main_file = "${ps_main_dir}/prometheus.yml"