From b71f101e909c4725954a5c8f8337543304366bef Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 2 Jan 2025 14:27:07 +0100 Subject: [PATCH] node_exporter: Move data from hiera to puppet class --- REFERENCE.md | 14 ++++++++++++++ data/defaults.yaml | 7 ------- manifests/node_exporter.pp | 14 +++++++------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 754c93425..0305e2a94 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -7997,6 +7997,8 @@ Data type: `String` Extension for the release binary archive +Default value: `'tar.gz'` + ##### `download_url` Data type: `Optional[Prometheus::Uri]` @@ -8011,12 +8013,16 @@ Data type: `Prometheus::Uri` Base URL for the binary archive +Default value: `'https://github.com/prometheus/node_exporter/releases'` + ##### `extra_groups` Data type: `Array[String]` Extra groups to add the binary user to +Default value: `[]` + ##### `extra_options` Data type: `Optional[String[1]]` @@ -8031,6 +8037,8 @@ Data type: `String[1]` Group under which the binary is running +Default value: `'node-exporter'` + ##### `init_style` Data type: `Prometheus::Initstyle` @@ -8085,12 +8093,16 @@ Data type: `String[1]` If package, then use this for package ensure default 'latest' +Default value: `'latest'` + ##### `package_name` Data type: `String[1]` The binary package name - not available yet +Default value: `'node_exporter'` + ##### `purge_config_dir` Data type: `Boolean` @@ -8137,6 +8149,8 @@ Data type: `String[1]` User which runs the service +Default value: `'node-exporter'` + ##### `version` Data type: `String[1]` diff --git a/data/defaults.yaml b/data/defaults.yaml index 7146ecc4d..e6446c896 100644 --- a/data/defaults.yaml +++ b/data/defaults.yaml @@ -149,10 +149,3 @@ prometheus::mysqld_exporter::group: 'mysqld-exporter' prometheus::mysqld_exporter::package_ensure: 'latest' prometheus::mysqld_exporter::package_name: 'mysqld_exporter' prometheus::mysqld_exporter::user: 'mysqld-exporter' -prometheus::node_exporter::download_extension: 'tar.gz' -prometheus::node_exporter::download_url_base: 'https://github.com/prometheus/node_exporter/releases' -prometheus::node_exporter::extra_groups: [] -prometheus::node_exporter::group: 'node-exporter' -prometheus::node_exporter::package_ensure: 'latest' -prometheus::node_exporter::package_name: 'node_exporter' -prometheus::node_exporter::user: 'node-exporter' diff --git a/manifests/node_exporter.pp b/manifests/node_exporter.pp index 755763ea6..fbb5ce1be 100644 --- a/manifests/node_exporter.pp +++ b/manifests/node_exporter.pp @@ -70,13 +70,13 @@ # Scrape port for configuring scrape targets on the prometheus server via exported `prometheus::scrape_job` resources # If changed from default 9100 the option `--web.listen-address=':${scrape_port}'` will be added to the command line arguments class prometheus::node_exporter ( - String $download_extension, - Prometheus::Uri $download_url_base, - Array[String] $extra_groups, - String[1] $group, - String[1] $package_ensure, - String[1] $package_name, - String[1] $user, + String $download_extension = 'tar.gz', + Prometheus::Uri $download_url_base = 'https://github.com/prometheus/node_exporter/releases', + Array[String] $extra_groups = [], + String[1] $group = 'node-exporter', + String[1] $package_ensure = 'latest', + String[1] $package_name = 'node_exporter', + String[1] $user = 'node-exporter', # renovate: depName=prometheus/node_exporter String[1] $version = '1.8.1', Boolean $purge_config_dir = true,