OP#195 change class names
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
# Readme
|
# Readme
|
||||||
|
|
||||||
[](https://jenkins.confdroid.com/job/prometheus_cd/)
|
[](https://jenkins.confdroid.com/job/confdroid_prometheus/)
|
||||||
|
|
||||||
## Synopsis
|
## Synopsis
|
||||||
|
|
||||||
Prometheus is an open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach.
|
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.
|
`confdroid_prometheus` 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)
|
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
|
## WARNING
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# prometheus_cd::firewall::iptables.pp
|
# confdroid_prometheus::firewall::iptables.pp
|
||||||
# Module name: prometheus_cd
|
# Module name: confdroid_prometheus
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||||
# @summary Class manages the firewall rules for the prometheus_cd module.
|
# @summary Class manages the firewall rules for the confdroid_prometheus module.
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class prometheus_cd::firewall::iptables (
|
class confdroid_prometheus::firewall::iptables (
|
||||||
) inherits prometheus_cd::params {
|
) inherits confdroid_prometheus::params {
|
||||||
if ($ps_prom_host == $fqdn) and ($ps_manage_fw == true) {
|
if ($ps_prom_host == $fqdn) and ($ps_manage_fw == true) {
|
||||||
# main port
|
# main port
|
||||||
firewall { "${ps_fw_prefix}${$ps_main_port} main port":
|
firewall { "${ps_fw_prefix}${$ps_main_port} main port":
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# prometheus_cd::init.pp
|
# confdroid_prometheus::init.pp
|
||||||
# Module name: prometheus_cd
|
# Module name: confdroid_prometheus
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||||
# @summary Class initializes the prometheus_cd module.
|
# @summary Class initializes the confdroid_prometheus module.
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class prometheus_cd {
|
class confdroid_prometheus {
|
||||||
include prometheus_cd::params
|
include confdroid_prometheus::params
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# prometheus_cd::main::config.pp
|
# confdroid_prometheus::main::config.pp
|
||||||
# Module name: prometheus_cd
|
# Module name: confdroid_prometheus
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||||
# @summary Class manages the module logic for the prometheus_cd module.
|
# @summary Class manages the module logic for the confdroid_prometheus module.
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class prometheus_cd::main::config (
|
class confdroid_prometheus::main::config (
|
||||||
) inherits prometheus_cd::params {
|
) inherits confdroid_prometheus::params {
|
||||||
include prometheus_cd::main::service
|
include confdroid_prometheus::main::service
|
||||||
|
|
||||||
exec { 'systemd-daemon-reload':
|
exec { 'systemd-daemon-reload':
|
||||||
command => '/bin/systemctl daemon-reload',
|
command => '/bin/systemctl daemon-reload',
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# prometheus_cd::main::dirs.pp
|
# confdroid_prometheus::main::dirs.pp
|
||||||
# Module name: prometheus_cd
|
# Module name: confdroid_prometheus
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||||
# @summary Class manages directories for the prometheus_cd module.
|
# @summary Class manages directories for the confdroid_prometheus module.
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class prometheus_cd::main::dirs (
|
class confdroid_prometheus::main::dirs (
|
||||||
) inherits prometheus_cd::params {
|
) inherits confdroid_prometheus::params {
|
||||||
require prometheus_cd::main::install
|
require confdroid_prometheus::main::install
|
||||||
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
|
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
|
||||||
# prometheus directory
|
# prometheus directory
|
||||||
file { $ps_main_dir:
|
file { $ps_main_dir:
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# prometheus_cd::main::files.pp
|
# confdroid_prometheus::main::files.pp
|
||||||
# Module name: prometheus_cd
|
# Module name: confdroid_prometheus
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||||
# @summary Class manages configuration files for the prometheus_cd module.
|
# @summary Class manages configuration files for the confdroid_prometheus module.
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class prometheus_cd::main::files (
|
class confdroid_prometheus::main::files (
|
||||||
) inherits prometheus_cd::params {
|
) inherits confdroid_prometheus::params {
|
||||||
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
|
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
|
||||||
require prometheus_cd::main::dirs
|
require confdroid_prometheus::main::dirs
|
||||||
file { $ps_main_file:
|
file { $ps_main_file:
|
||||||
ensure => file,
|
ensure => file,
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
@@ -16,7 +16,7 @@ class prometheus_cd::main::files (
|
|||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => etc_t,
|
seltype => etc_t,
|
||||||
seluser => system_u,
|
seluser => system_u,
|
||||||
content => template('prometheus_cd/prometheus.yml.erb'),
|
content => template('confdroid_prometheus/prometheus.yml.erb'),
|
||||||
notify => Service[$ps_prom_service],
|
notify => Service[$ps_prom_service],
|
||||||
}
|
}
|
||||||
file { $ps_system_service_file:
|
file { $ps_system_service_file:
|
||||||
@@ -28,7 +28,7 @@ class prometheus_cd::main::files (
|
|||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => systemd_unit_file_t,
|
seltype => systemd_unit_file_t,
|
||||||
seluser => unconfined_u,
|
seluser => unconfined_u,
|
||||||
content => template('prometheus_cd/override.conf.erb'),
|
content => template('confdroid_prometheus/override.conf.erb'),
|
||||||
notify => Service[$ps_prom_service],
|
notify => Service[$ps_prom_service],
|
||||||
}
|
}
|
||||||
file { $ps_web_config_file:
|
file { $ps_web_config_file:
|
||||||
@@ -40,7 +40,7 @@ class prometheus_cd::main::files (
|
|||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => etc_t,
|
seltype => etc_t,
|
||||||
seluser => system_u,
|
seluser => system_u,
|
||||||
content => template('prometheus_cd/web.yml.erb'),
|
content => template('confdroid_prometheus/web.yml.erb'),
|
||||||
notify => Service[$ps_prom_service],
|
notify => Service[$ps_prom_service],
|
||||||
}
|
}
|
||||||
if $ps_enable_pruning == true {
|
if $ps_enable_pruning == true {
|
||||||
@@ -53,7 +53,7 @@ class prometheus_cd::main::files (
|
|||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => usr_,
|
seltype => usr_,
|
||||||
seluser => unconfined_u,
|
seluser => unconfined_u,
|
||||||
content => template('prometheus_cd/prune_blocks.erb'),
|
content => template('confdroid_prometheus/prune_blocks.erb'),
|
||||||
# notify Service ToDo,
|
# notify Service ToDo,
|
||||||
}
|
}
|
||||||
file { $ps_env_file:
|
file { $ps_env_file:
|
||||||
@@ -65,7 +65,7 @@ class prometheus_cd::main::files (
|
|||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => usr_,
|
seltype => usr_,
|
||||||
seluser => unconfined_u,
|
seluser => unconfined_u,
|
||||||
content => template('prometheus_cd/prune.env.erb'),
|
content => template('confdroid_prometheus/prune.env.erb'),
|
||||||
}
|
}
|
||||||
file { $ps_pruning_svc_file:
|
file { $ps_pruning_svc_file:
|
||||||
ensure => file,
|
ensure => file,
|
||||||
@@ -76,7 +76,7 @@ class prometheus_cd::main::files (
|
|||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => systemd_unit_file_t,
|
seltype => systemd_unit_file_t,
|
||||||
seluser => unconfined_u,
|
seluser => unconfined_u,
|
||||||
content => template('prometheus_cd/prometheus-prune-service.erb'),
|
content => template('confdroid_prometheus/prometheus-prune-service.erb'),
|
||||||
notify => Exec['systemd-daemon-reload'],
|
notify => Exec['systemd-daemon-reload'],
|
||||||
}
|
}
|
||||||
file { $ps_pruning_timer_file:
|
file { $ps_pruning_timer_file:
|
||||||
@@ -88,7 +88,7 @@ class prometheus_cd::main::files (
|
|||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => systemd_unit_file_t,
|
seltype => systemd_unit_file_t,
|
||||||
seluser => unconfined_u,
|
seluser => unconfined_u,
|
||||||
content => template('prometheus_cd/prometheus-prune-timer.erb'),
|
content => template('confdroid_prometheus/prometheus-prune-timer.erb'),
|
||||||
notify => Exec['systemd-daemon-reload'],
|
notify => Exec['systemd-daemon-reload'],
|
||||||
}
|
}
|
||||||
file { $ps_prune_log_file:
|
file { $ps_prune_log_file:
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# prometheus_cd::main::install.pp
|
# confdroid_prometheus::main::install.pp
|
||||||
# Module name: prometheus_cd
|
# Module name: confdroid_prometheus
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||||
# @summary Class install binaries for the prometheus_cd module.
|
# @summary Class install binaries for the confdroid_prometheus module.
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class prometheus_cd::main::install (
|
class confdroid_prometheus::main::install (
|
||||||
) inherits prometheus_cd::params {
|
) inherits confdroid_prometheus::params {
|
||||||
require prometheus_cd::main::yumrepo
|
require confdroid_prometheus::main::yumrepo
|
||||||
if $manage_prometheus == true {
|
if $manage_prometheus == true {
|
||||||
package { $reqpackage_prom:
|
package { $reqpackage_prom:
|
||||||
ensure => $pkg_ensure,
|
ensure => $pkg_ensure,
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# prometheus_cd::main::service.pp
|
# confdroid_prometheus::main::service.pp
|
||||||
# Module name: prometheus_cd
|
# Module name: confdroid_prometheus
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||||
# @summary Class manages the services for the prometheus_cd module.
|
# @summary Class manages the services for the confdroid_prometheus module.
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class prometheus_cd::main::service (
|
class confdroid_prometheus::main::service (
|
||||||
) inherits prometheus_cd::params {
|
) inherits confdroid_prometheus::params {
|
||||||
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
|
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
|
||||||
require prometheus_cd::main::files
|
require confdroid_prometheus::main::files
|
||||||
require prometheus_cd::firewall::iptables
|
require confdroid_prometheus::firewall::iptables
|
||||||
service { $ps_prom_service:
|
service { $ps_prom_service:
|
||||||
ensure => running,
|
ensure => running,
|
||||||
hasstatus => true,
|
hasstatus => true,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# prometheus_cd::main::yumrepo.pp
|
# confdroid_prometheus::main::yumrepo.pp
|
||||||
# Module name: prometheus_cd
|
# Module name: confdroid_prometheus
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||||
# @summary Class manages yumrepo for the prometheus_cd module.
|
# @summary Class manages yumrepo for the confdroid_prometheus module.
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class prometheus_cd::main::yumrepo (
|
class confdroid_prometheus::main::yumrepo (
|
||||||
) inherits prometheus_cd::params {
|
) inherits confdroid_prometheus::params {
|
||||||
yumrepo { 'prometheus':
|
yumrepo { 'prometheus':
|
||||||
ensure => 'present',
|
ensure => 'present',
|
||||||
name => 'prometheus',
|
name => 'prometheus',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# prometheus_cd::params.pp
|
# confdroid_prometheus::params.pp
|
||||||
# Module name: prometheus_cd
|
# Module name: confdroid_prometheus
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||||
# @summary Class holds all parameters for the prometheus_cd module.
|
# @summary Class holds all parameters for the confdroid_prometheus module.
|
||||||
# @param [String] reqpackage_prom the prometheus package
|
# @param [String] reqpackage_prom the prometheus package
|
||||||
# @param [String] reqpackage_ne the node_exporter package
|
# @param [String] reqpackage_ne the node_exporter package
|
||||||
# @param [String] pkg_ensure which version of the package to install
|
# @param [String] pkg_ensure which version of the package to install
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
# @param [String] ps_grace_hours Grace period in hours to be extra safe
|
# @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 [String] ps_sql_template the SQL template to use for checks.
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class prometheus_cd::params (
|
class confdroid_prometheus::params (
|
||||||
|
|
||||||
# installation
|
# installation
|
||||||
String $reqpackage_prom = 'prometheus2',
|
String $reqpackage_prom = 'prometheus2',
|
||||||
@@ -128,5 +128,5 @@ class prometheus_cd::params (
|
|||||||
$ps_prune_timer = 'prometheus-prune.timer'
|
$ps_prune_timer = 'prometheus-prune.timer'
|
||||||
|
|
||||||
# includes must be last
|
# includes must be last
|
||||||
include prometheus_cd::main::config
|
include confdroid_prometheus::main::config
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user