diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a19134..52f999b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "cSpell.words": [ + "reqpackage", "rpms", "sslcacert", "sslverify" diff --git a/README.md b/README.md index 2ac8bc1..cb8986b 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Prometheus is an open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach. `prometheus_cd` is a Puppet module to automate installation and configuration of prometheus and node exporter. +This module supports either managing prometheus or node_exporter or both. You need to set the parameters `$manage_prometheus`and / or `$manage_node_exporter`to true ( false by default) ## WARNING diff --git a/doc/file.README.html b/doc/file.README.html index e764b9b..19eb6cd 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -68,7 +68,7 @@
Prometheus is an open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach.
-prometheus_cd is a Puppet module to automate installation and configuration of prometheus and node exporter.
prometheus_cd is a Puppet module to automate installation and configuration of prometheus and node exporter. This module supports either managing prometheus or node_exporter or both. You need to set the parameters $manage_prometheusand / or $manage_node_exporterto true ( false by default)
Prometheus is an open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach.
-prometheus_cd is a Puppet module to automate installation and configuration of prometheus and node exporter.
prometheus_cd is a Puppet module to automate installation and configuration of prometheus and node exporter. This module supports either managing prometheus or node_exporter or both. You need to set the parameters $manage_prometheusand / or $manage_node_exporterto true ( false by default)
# File 'manifests/main/install.pp', line 6
@@ -112,6 +122,16 @@
class prometheus_cd::main::install (
) inherits prometheus_cd::params {
require prometheus_cd::main::yumrepo
+ if $manage_prometheus == true {
+ package { $reqpackage_prom:
+ ensure => $pkg_ensure,
+ }
+ }
+ if $manage_node_exporter == true {
+ package { $reqpackage_ne:
+ ensure => $pkg_ensure,
+ }
+ }
}
-6 -7 -8 -9 -10 -11+11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21
# File 'manifests/params.pp', line 6
+ # File 'manifests/params.pp', line 11
class prometheus_cd::params (
+ String $reqpackage_prom = 'prometheus',
+ String $reqpackage_ne = 'node_exporter',
+ String $pkg_ensure = 'present',
+ Boolean $manage_prometheus = false,
+ Boolean $manage_node_exporter = false,
) {
# includes must be last
diff --git a/manifests/main/install.pp b/manifests/main/install.pp
index 8a0664b..ba8dca3 100644
--- a/manifests/main/install.pp
+++ b/manifests/main/install.pp
@@ -6,4 +6,14 @@
class prometheus_cd::main::install (
) inherits prometheus_cd::params {
require prometheus_cd::main::yumrepo
+ if $manage_prometheus == true {
+ package { $reqpackage_prom:
+ ensure => $pkg_ensure,
+ }
+ }
+ if $manage_node_exporter == true {
+ package { $reqpackage_ne:
+ ensure => $pkg_ensure,
+ }
+ }
}
diff --git a/manifests/params.pp b/manifests/params.pp
index 371e82e..97298b0 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -2,8 +2,18 @@
# 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
##############################################################################
class prometheus_cd::params (
+ String $reqpackage_prom = 'prometheus',
+ String $reqpackage_ne = 'node_exporter',
+ String $pkg_ensure = 'present',
+ Boolean $manage_prometheus = false,
+ Boolean $manage_node_exporter = false,
) {
# includes must be last