From e487f2be18fa1c36916d03b27c4bbb699970464b Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Sat, 18 Oct 2025 16:30:54 +0200 Subject: [PATCH 1/2] add web config - https://gitlab.confdroid.com/internal/confdroid_management/-/issues/260 --- manifests/main/files.pp | 12 ++++++++++++ manifests/params.pp | 3 +++ templates/web.yml.erb | 5 +++++ 3 files changed, 20 insertions(+) create mode 100644 templates/web.yml.erb diff --git a/manifests/main/files.pp b/manifests/main/files.pp index 06011b3..0d8c38f 100644 --- a/manifests/main/files.pp +++ b/manifests/main/files.pp @@ -31,5 +31,17 @@ class prometheus_cd::main::files ( content => template('prometheus_cd/override.conf.erb'), notify => Service[$ps_prom_service], } + file { $ps_web_config_file: + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + selrange => s0, + selrole => object_r, + seltype => etc_t, + seluser => system_u, + content => template('prometheus_cd/web.yml.erb'), + notify => Service[$ps_prom_service], + } } } diff --git a/manifests/params.pp b/manifests/params.pp index 70a2d11..e655d6e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -13,6 +13,7 @@ # @param [String] ps_main_port the firewall main port for prometheus # @param [String] ps_auth_user the username for authentication # @param [String] ps_auth_pass the password for authentication +# @param [String] ps_web_pass the password for web authentication # @param [String] ps_retention_time tsdb retention time # @param [String] ps_retention_size tsdb retention size ############################################################################## @@ -36,6 +37,7 @@ class prometheus_cd::params ( # auth String $ps_auth_user = 'changeme', String $ps_auth_pass = 'changeme', + String $ps_web_pass = 'changeme', # storage String $ps_retention_time = '15d', @@ -54,6 +56,7 @@ class prometheus_cd::params ( # files $ps_main_file = "${ps_main_dir}/prometheus.yml" + $ps_web_config_file = "${ps_main_dir}/web.yml" $ps_system_service_file = "${ps_system_file_dir}/override.conf" # services diff --git a/templates/web.yml.erb b/templates/web.yml.erb new file mode 100644 index 0000000..09992bd --- /dev/null +++ b/templates/web.yml.erb @@ -0,0 +1,5 @@ +############################################################################## +##### File created by Puppet - manual changes will be overwritten ##### +############################################################################### +basic_auth_users: + <%= @ps_auth_user %>: <%= @ps_web_pass %> \ No newline at end of file From c13bed3a4e902cb10b25099a8f4f3ec75e1e0c3d Mon Sep 17 00:00:00 2001 From: Jenkins Server Date: Sat, 18 Oct 2025 16:32:09 +0200 Subject: [PATCH 2/2] Recommit for updates in build 32 --- .../prometheus_cd_3A_3Amain_3A_3Afiles.html | 26 ++++++++++++++++- .../prometheus_cd_3A_3Aparams.html | 28 +++++++++++++++++-- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/doc/puppet_classes/prometheus_cd_3A_3Amain_3A_3Afiles.html b/doc/puppet_classes/prometheus_cd_3A_3Amain_3A_3Afiles.html index 9d95201..0a4b684 100644 --- a/doc/puppet_classes/prometheus_cd_3A_3Amain_3A_3Afiles.html +++ b/doc/puppet_classes/prometheus_cd_3A_3Amain_3A_3Afiles.html @@ -130,7 +130,19 @@ 32 33 34 -35 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47
# File 'manifests/main/files.pp', line 6
@@ -163,6 +175,18 @@ class prometheus_cd::main::files (
       content  => template('prometheus_cd/override.conf.erb'),
       notify   => Service[$ps_prom_service],
     }
+    file { $ps_web_config_file:
+      ensure   => file,
+      owner    => 'root',
+      group    => 'root',
+      mode     => '0644',
+      selrange => s0,
+      selrole  => object_r,
+      seltype  => etc_t,
+      seluser  => system_u,
+      content  => template('prometheus_cd/web.yml.erb'),
+      notify   => Service[$ps_prom_service],
+    }
   }
 }
diff --git a/doc/puppet_classes/prometheus_cd_3A_3Aparams.html b/doc/puppet_classes/prometheus_cd_3A_3Aparams.html index 0c1f259..3ab5fc0 100644 --- a/doc/puppet_classes/prometheus_cd_3A_3Aparams.html +++ b/doc/puppet_classes/prometheus_cd_3A_3Aparams.html @@ -308,6 +308,24 @@ +
  • + + ps_web_pass + + + (String) + + + (defaults to: 'changeme') + + + — +
    +

    the password for web authentication

    +
    + +
  • +
  • ps_retention_time @@ -355,7 +373,6 @@
     
     
    -19
     20
     21
     22
    @@ -401,10 +418,13 @@
     62
     63
     64
    -65
    +65 +66 +67 +68 -
    # File 'manifests/params.pp', line 19
    +        
    # File 'manifests/params.pp', line 20
     
     class prometheus_cd::params (
     
    @@ -426,6 +446,7 @@ class prometheus_cd::params (
       # auth
       String $ps_auth_user          = 'changeme',
       String $ps_auth_pass          = 'changeme',
    +  String $ps_web_pass           = 'changeme',
     
       # storage
       String $ps_retention_time     = '15d',
    @@ -444,6 +465,7 @@ class prometheus_cd::params (
     
       # files
       $ps_main_file           = "${ps_main_dir}/prometheus.yml"
    +  $ps_web_config_file     = "${ps_main_dir}/web.yml"
       $ps_system_service_file = "${ps_system_file_dir}/override.conf"
     
       # services