3
0

Recommit for updates in build 15

This commit is contained in:
2025-10-18 12:35:37 +02:00
parent 7edd5cf2e6
commit e56129baa9
6 changed files with 294 additions and 16 deletions

View File

@@ -73,6 +73,11 @@
</li> </li>
<li>
<span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Afirewall_3A_3Aiptables.html" title="puppet_classes::prometheus_cd::firewall::iptables (puppet_class)">prometheus_cd::firewall::iptables</a></span>
</li>
<li> <li>
<span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Aconfig.html" title="puppet_classes::prometheus_cd::main::config (puppet_class)">prometheus_cd::main::config</a></span> <span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Aconfig.html" title="puppet_classes::prometheus_cd::main::config (puppet_class)">prometheus_cd::main::config</a></span>

View File

@@ -43,49 +43,56 @@
</li> </li>
<li id="object_puppet_classes::prometheus_cd::main::config" class="even"> <li id="object_puppet_classes::prometheus_cd::firewall::iptables" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Afirewall_3A_3Aiptables.html" title="puppet_classes::prometheus_cd::firewall::iptables (puppet_class)">prometheus_cd::firewall::iptables</a></span>
</div>
</li>
<li id="object_puppet_classes::prometheus_cd::main::config" class="odd">
<div class="item"> <div class="item">
<span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Aconfig.html" title="puppet_classes::prometheus_cd::main::config (puppet_class)">prometheus_cd::main::config</a></span> <span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Aconfig.html" title="puppet_classes::prometheus_cd::main::config (puppet_class)">prometheus_cd::main::config</a></span>
</div> </div>
</li> </li>
<li id="object_puppet_classes::prometheus_cd::main::dirs" class="odd"> <li id="object_puppet_classes::prometheus_cd::main::dirs" class="even">
<div class="item"> <div class="item">
<span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Adirs.html" title="puppet_classes::prometheus_cd::main::dirs (puppet_class)">prometheus_cd::main::dirs</a></span> <span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Adirs.html" title="puppet_classes::prometheus_cd::main::dirs (puppet_class)">prometheus_cd::main::dirs</a></span>
</div> </div>
</li> </li>
<li id="object_puppet_classes::prometheus_cd::main::files" class="even"> <li id="object_puppet_classes::prometheus_cd::main::files" class="odd">
<div class="item"> <div class="item">
<span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Afiles.html" title="puppet_classes::prometheus_cd::main::files (puppet_class)">prometheus_cd::main::files</a></span> <span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Afiles.html" title="puppet_classes::prometheus_cd::main::files (puppet_class)">prometheus_cd::main::files</a></span>
</div> </div>
</li> </li>
<li id="object_puppet_classes::prometheus_cd::main::install" class="odd"> <li id="object_puppet_classes::prometheus_cd::main::install" class="even">
<div class="item"> <div class="item">
<span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Ainstall.html" title="puppet_classes::prometheus_cd::main::install (puppet_class)">prometheus_cd::main::install</a></span> <span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Ainstall.html" title="puppet_classes::prometheus_cd::main::install (puppet_class)">prometheus_cd::main::install</a></span>
</div> </div>
</li> </li>
<li id="object_puppet_classes::prometheus_cd::main::service" class="even"> <li id="object_puppet_classes::prometheus_cd::main::service" class="odd">
<div class="item"> <div class="item">
<span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Aservice.html" title="puppet_classes::prometheus_cd::main::service (puppet_class)">prometheus_cd::main::service</a></span> <span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Aservice.html" title="puppet_classes::prometheus_cd::main::service (puppet_class)">prometheus_cd::main::service</a></span>
</div> </div>
</li> </li>
<li id="object_puppet_classes::prometheus_cd::main::yumrepo" class="odd"> <li id="object_puppet_classes::prometheus_cd::main::yumrepo" class="even">
<div class="item"> <div class="item">
<span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Ayumrepo.html" title="puppet_classes::prometheus_cd::main::yumrepo (puppet_class)">prometheus_cd::main::yumrepo</a></span> <span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Amain_3A_3Ayumrepo.html" title="puppet_classes::prometheus_cd::main::yumrepo (puppet_class)">prometheus_cd::main::yumrepo</a></span>
</div> </div>
</li> </li>
<li id="object_puppet_classes::prometheus_cd::params" class="even"> <li id="object_puppet_classes::prometheus_cd::params" class="odd">
<div class="item"> <div class="item">
<span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Aparams.html" title="puppet_classes::prometheus_cd::params (puppet_class)">prometheus_cd::params</a></span> <span class='object_link'><a href="puppet_classes/prometheus_cd_3A_3Aparams.html" title="puppet_classes::prometheus_cd::params (puppet_class)">prometheus_cd::params</a></span>
</div> </div>

View File

@@ -0,0 +1,142 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Puppet Class: prometheus_cd::firewall::iptables
&mdash; Documentation by YARD 0.9.36
</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" />
<link rel="stylesheet" href="../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "puppet_classes::prometheus_cd::firewall::iptables";
relpath = '../';
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../puppet_class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../_index.html">Index (p)</a> &raquo;
<span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo;
<span class="title">prometheus_cd::firewall::iptables</span>
</div>
<div id="search">
<a class="full_list_link" id="puppet_class_list_link"
href="../puppet_class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Puppet Class: prometheus_cd::firewall::iptables</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd><span class='object_link'><a href="prometheus_cd_3A_3Aparams.html" title="puppet_classes::prometheus_cd::params (puppet_class)">prometheus_cd::params</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>
manifests/firewall/iptables.pp
</dd>
</dl>
</div>
<h2>Summary</h2>
Class manages the firewall rules for the prometheus_cd module.
<h2>Overview</h2>
<div class="docstring">
<div class="discussion">
<p>prometheus_cd::firewall::iptables.pp Module name: prometheus_cd Author: Arne Teuke (arne_teuke@confdroid.com)</p>
</div>
</div>
<div class="tags">
</div><div class="method_details_list">
<table class="source_code">
<tr>
<td>
<pre class="lines">
6
7
8
9
10
11
12
13
14
15
16</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/firewall/iptables.pp', line 6</span>
class prometheus_cd::firewall::iptables (
) inherits prometheus_cd::params {
if ($ps_prom_host == $fqdn) and ($ps_manage_fw == true) {
# main port
firewall { &quot;${ps_fw_prefix}${$ps_main_port} main port&quot;:
proto =&gt; &#39;tcp&#39;,
dport =&gt; $ps_main_port,
jump =&gt; &#39;accept&#39;,
}
}
}</pre>
</td>
</tr>
</table>
</div>
</div>
<div id="footer">
Generated by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>.
</div>
</div>
</body>
</html>

View File

@@ -104,7 +104,19 @@
6 6
7 7
8 8
9</pre> 9
10
11
12
13
14
15
16
17
18
19
20
21</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/main/dirs.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/dirs.pp', line 6</span>
@@ -112,6 +124,18 @@
class prometheus_cd::main::dirs ( class prometheus_cd::main::dirs (
) inherits prometheus_cd::params { ) inherits prometheus_cd::params {
require prometheus_cd::main::install require prometheus_cd::main::install
if $ps_prom_host == fqdn {
file { $ps_main_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; etc_t,
seluser =&gt; system_u,
}
}
}</pre> }</pre>
</td> </td>
</tr> </tr>

View File

@@ -120,7 +120,8 @@
22 22
23 23
24 24
25</pre> 25
26</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/main/service.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/service.pp', line 6</span>
@@ -128,7 +129,8 @@
class prometheus_cd::main::service ( class prometheus_cd::main::service (
) inherits prometheus_cd::params { ) inherits prometheus_cd::params {
require prometheus_cd::main::files require prometheus_cd::main::files
if $manage_prometheus == true { require prometheus_cd::firewall::iptables
if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) {
service { &#39;prometheus&#39;: service { &#39;prometheus&#39;:
ensure =&gt; running, ensure =&gt; running,
hasstatus =&gt; true, hasstatus =&gt; true,

View File

@@ -79,6 +79,8 @@
<span class='object_link'><a href="prometheus_cd_3A_3Amain_3A_3Ayumrepo.html" title="puppet_classes::prometheus_cd::main::yumrepo (puppet_class)">prometheus_cd::main::yumrepo</a></span><br/> <span class='object_link'><a href="prometheus_cd_3A_3Amain_3A_3Ayumrepo.html" title="puppet_classes::prometheus_cd::main::yumrepo (puppet_class)">prometheus_cd::main::yumrepo</a></span><br/>
<span class='object_link'><a href="prometheus_cd_3A_3Afirewall_3A_3Aiptables.html" title="puppet_classes::prometheus_cd::firewall::iptables (puppet_class)">prometheus_cd::firewall::iptables</a></span><br/>
</dd> </dd>
</dl> </dl>
@@ -194,6 +196,78 @@
&mdash; &mdash;
<div class='inline'> <div class='inline'>
<p>whether to manage node exporter</p> <p>whether to manage node exporter</p>
</div>
</li>
<li>
<span class='name'>ps_manage_fw</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>false</tt>)</em>
&mdash;
<div class='inline'>
<p>whether to manage the firewall</p>
</div>
</li>
<li>
<span class='name'>ps_prom_host</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;prometheus.example.net&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the fqdn of the prometheus server</p>
</div>
</li>
<li>
<span class='name'>ps_fw_prefix</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;50&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the firewall rule prefix</p>
</div>
</li>
<li>
<span class='name'>ps_main_port</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;9090&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the firewall main port for prometheus</p>
</div> </div>
</li> </li>
@@ -209,10 +283,6 @@
<pre class="lines"> <pre class="lines">
11
12
13
14
15 15
16 16
17 17
@@ -226,18 +296,43 @@
25 25
26 26
27 27
28</pre> 28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 11</span> <pre class="code"><span class="info file"># File 'manifests/params.pp', line 15</span>
class prometheus_cd::params ( class prometheus_cd::params (
# installation
String $reqpackage_prom = &#39;prometheus2&#39;, String $reqpackage_prom = &#39;prometheus2&#39;,
String $reqpackage_ne = &#39;node_exporter&#39;, String $reqpackage_ne = &#39;node_exporter&#39;,
String $pkg_ensure = &#39;present&#39;, String $pkg_ensure = &#39;present&#39;,
# config logic
Boolean $manage_prometheus = false, Boolean $manage_prometheus = false,
Boolean $manage_node_exporter = false, Boolean $manage_node_exporter = false,
Boolean $ps_manage_fw = false,
String $ps_prom_host = &#39;prometheus.example.net&#39;,
# firewall
String $ps_fw_prefix = &#39;50&#39;,
String $ps_main_port = &#39;9090&#39;,
) { ) {
# defaults # defaults
@@ -246,6 +341,9 @@ class prometheus_cd::params (
$os_name = $facts[&#39;os&#39;][&#39;name&#39;] $os_name = $facts[&#39;os&#39;][&#39;name&#39;]
$os_release = $facts[&#39;os&#39;][&#39;release&#39;][&#39;major&#39;] $os_release = $facts[&#39;os&#39;][&#39;release&#39;][&#39;major&#39;]
# dirs
$ps_main_dir = &#39;/etc/prometheus&#39;
# includes must be last # includes must be last
include prometheus_cd::main::config include prometheus_cd::main::config
}</pre> }</pre>