From 8c0b8a09044fb5e0b0955f18256e778384d3420e Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 2 Jan 2025 15:33:40 +0100 Subject: [PATCH] mysql_exporter: Move data from hiera to puppet class --- REFERENCE.md | 14 ++++++++++++++ data/defaults.yaml | 7 ------- manifests/mysqld_exporter.pp | 14 +++++++------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 0305e2a9..72ae775d 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -7061,6 +7061,8 @@ Data type: `String` Extension for the release binary archive +Default value: `'tar.gz'` + ##### `download_url` Data type: `Optional[Prometheus::Uri]` @@ -7075,12 +7077,16 @@ Data type: `Prometheus::Uri` Base URL for the binary archive +Default value: `'https://github.com/prometheus/mysqld_exporter/releases'` + ##### `extra_groups` Data type: `Array` Extra groups to add the binary user to +Default value: `[]` + ##### `extra_options` Data type: `Optional[String[1]]` @@ -7095,6 +7101,8 @@ Data type: `String[1]` Group under which the binary is running +Default value: `'mysqld-exporter'` + ##### `init_style` Data type: `Prometheus::Initstyle` @@ -7149,12 +7157,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: `'mysqld_exporter'` + ##### `purge_config_dir` Data type: `Boolean` @@ -7201,6 +7213,8 @@ Data type: `String[1]` User which runs the service +Default value: `'mysqld-exporter'` + ##### `version` Data type: `String[1]` diff --git a/data/defaults.yaml b/data/defaults.yaml index e6446c89..e05ec137 100644 --- a/data/defaults.yaml +++ b/data/defaults.yaml @@ -142,10 +142,3 @@ prometheus::rabbitmq_exporter::rabbit_exporters: - 'node' - 'overview' - 'queue' -prometheus::mysqld_exporter::download_extension: 'tar.gz' -prometheus::mysqld_exporter::download_url_base: 'https://github.com/prometheus/mysqld_exporter/releases' -prometheus::mysqld_exporter::extra_groups: [] -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' diff --git a/manifests/mysqld_exporter.pp b/manifests/mysqld_exporter.pp index f533cded..afe64f2a 100644 --- a/manifests/mysqld_exporter.pp +++ b/manifests/mysqld_exporter.pp @@ -75,13 +75,13 @@ # @param cnf_ssl_key # The path name of the client SSL private key file in PEM format. class prometheus::mysqld_exporter ( - String $download_extension, - Prometheus::Uri $download_url_base, - Array $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/mysqld_exporter/releases', + Array $extra_groups = [], + String[1] $group = 'mysqld-exporter', + String[1] $package_ensure = 'latest', + String[1] $package_name = 'mysqld_exporter', + String[1] $user = 'mysqld-exporter', # renovate: depName=prometheus/mysqld_exporter String[1] $version = '0.15.1', String[1] $service_name = 'mysqld_exporter',