3
0

Merge branch 'jenkins-build-26' into 'master'

Auto-merge for build 26

See merge request puppet/prometheus_cd!25
This commit is contained in:
2025-10-18 13:30:54 +00:00
10 changed files with 94 additions and 14 deletions

View File

@@ -25,7 +25,6 @@ INSTALLATION
CONFIGURATION
* manage directories and files including templates
* manages the main alloy jenkins for loki and prometheus
* manage service
## Repo Documentation

View File

@@ -87,8 +87,6 @@
<ul><li>
<p>manage directories and files including templates</p>
</li><li>
<p>manages the main alloy jenkins for loki and prometheus</p>
</li><li>
<p>manage service</p>
</li></ul>

View File

@@ -87,8 +87,6 @@
<ul><li>
<p>manage directories and files including templates</p>
</li><li>
<p>manages the main alloy jenkins for loki and prometheus</p>
</li><li>
<p>manage service</p>
</li></ul>

View File

@@ -117,7 +117,18 @@
19
20
21
22</pre>
22
23
24
25
26
27
28
29
30
31
32
33</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/main/dirs.pp', line 6</span>
@@ -126,7 +137,7 @@ class prometheus_cd::main::dirs (
) inherits prometheus_cd::params {
require prometheus_cd::main::install
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
# prometheus directors
# prometheus directory
file { $ps_main_dir:
ensure =&gt; directory,
owner =&gt; &#39;root&#39;,
@@ -137,6 +148,17 @@ class prometheus_cd::main::dirs (
seltype =&gt; etc_t,
seluser =&gt; system_u,
}
# service systemfile directory
file { $ps_system_file_dir:
ensure =&gt; directory,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;root&#39;,
mode =&gt; &#39;0755&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; systemd_unit_file_t,
seluser =&gt; unconfined_u,
}
}
}</pre>
</td>

View File

@@ -118,15 +118,27 @@
20
21
22
23</pre>
23
24
25
26
27
28
29
30
31
32
33
34
35</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/main/files.pp', line 6</span>
class prometheus_cd::main::files (
) inherits prometheus_cd::params {
require prometheus_cd::main::dirs
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
require prometheus_cd::main::dirs
file { $ps_main_file:
ensure =&gt; file,
owner =&gt; &#39;root&#39;,
@@ -139,6 +151,18 @@ class prometheus_cd::main::files (
content =&gt; template(&#39;prometheus_cd/prometheus.yml.erb&#39;),
notify =&gt; Service[$ps_prom_service],
}
file { $ps_system_service_file:
ensure =&gt; file,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;root&#39;,
mode =&gt; &#39;0644&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; systemd_unit_file_t,
seluser =&gt; unconfined_u,
content =&gt; template(&#39;prometheus_cd/override.conf.erb&#39;),
notify =&gt; Service[$ps_prom_service],
}
}
}</pre>
</td>

View File

@@ -359,7 +359,9 @@
54
55
56
57</pre>
57
58
59</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 17</span>
@@ -394,9 +396,11 @@ class prometheus_cd::params (
# dirs
$ps_main_dir = &#39;/etc/prometheus&#39;
$ps_system_file_dir = &#39;/etc/systemd/system/prometheus.service.d&#39;
# files
$ps_main_file = &quot;${ps_main_dir}/prometheus.yml&quot;
$ps_system_service_file = &quot;${ps_system_file_dir}/override.conf&quot;
# services
$ps_prom_service = &#39;prometheus&#39;

View File

@@ -7,7 +7,7 @@ class prometheus_cd::main::dirs (
) inherits prometheus_cd::params {
require prometheus_cd::main::install
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
# prometheus directors
# prometheus directory
file { $ps_main_dir:
ensure => directory,
owner => 'root',
@@ -18,5 +18,16 @@ class prometheus_cd::main::dirs (
seltype => etc_t,
seluser => system_u,
}
# service systemfile directory
file { $ps_system_file_dir:
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
selrange => s0,
selrole => object_r,
seltype => systemd_unit_file_t,
seluser => unconfined_u,
}
}
}

View File

@@ -5,8 +5,8 @@
##############################################################################
class prometheus_cd::main::files (
) inherits prometheus_cd::params {
require prometheus_cd::main::dirs
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
require prometheus_cd::main::dirs
file { $ps_main_file:
ensure => file,
owner => 'root',
@@ -19,5 +19,17 @@ class prometheus_cd::main::files (
content => template('prometheus_cd/prometheus.yml.erb'),
notify => Service[$ps_prom_service],
}
file { $ps_system_service_file:
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
selrange => s0,
selrole => object_r,
seltype => systemd_unit_file_t,
seluser => unconfined_u,
content => template('prometheus_cd/override.conf.erb'),
notify => Service[$ps_prom_service],
}
}
}

View File

@@ -44,9 +44,11 @@ class prometheus_cd::params (
# dirs
$ps_main_dir = '/etc/prometheus'
$ps_system_file_dir = '/etc/systemd/system/prometheus.service.d'
# files
$ps_main_file = "${ps_main_dir}/prometheus.yml"
$ps_system_service_file = "${ps_system_file_dir}/override.conf"
# services
$ps_prom_service = 'prometheus'

View File

@@ -0,0 +1,10 @@
##############################################################################
##### File created by Puppet - manual changes will be overwritten #####
###############################################################################
[Service]
ExecStart=
ExecStart=/usr/bin/prometheus \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/var/lib/prometheus \
--web.enable-remote-write-receiver \
--web.enable-lifecycle