Compare commits

..

1 Commits

Author SHA1 Message Date
Jenkins Server
fcf141dc35 Recommit for updates in build 3 2026-07-22 12:45:57 +02:00
25 changed files with 1207 additions and 702 deletions

View File

@@ -2,7 +2,7 @@
[![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=confdroid_alloy&style=plastic)](https://jenkins.confdroid.com/job/confdroid_alloy/) [![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=confdroid_alloy&style=plastic)](https://jenkins.confdroid.com/job/confdroid_alloy/)
[![Security Hotspots](https://sonarqube.confdroid.com/api/project_badges/measure?project=confdroid_alloy&metric=security_hotspots&token=sqb_05c3bd9116b3d2585b1f06dd7b6d0d5a6433fe8b)](https://sonarqube.confdroid.com/dashboard?id=confdroid_alloy) [![Security Hotspots](https://sonarqube.confdroid.com/api/project_badges/measure?project=confdroid_alloy&metric=security_hotspots&token=sqb_05c3bd9116b3d2585b1f06dd7b6d0d5a6433fe8b)](https://sonarqube.confdroid.com/dashboard?id=confdroid_alloy)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/grizzlycoda/puppet_collection) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/grizzlycoda/puppet_collection)
- [Readme](#readme) - [Readme](#readme)
- [Synopsis](#synopsis) - [Synopsis](#synopsis)
@@ -37,6 +37,7 @@ Then you can use Grafana itself to visualize those logs and metrics and built an
INSTALLATION INSTALLATION
- installs alloy binaries - installs alloy binaries
- installs node exporter (optional, set `ay_manage_ne`to `true`)
CONFIGURATION CONFIGURATION
@@ -44,7 +45,6 @@ CONFIGURATION
- manages the main alloy pipeline for loki and prometheus - manages the main alloy pipeline for loki and prometheus
- manages log rotation for rsyslog to allow adm membership - manages log rotation for rsyslog to allow adm membership
- manage service - manage service
- optional: include nagios target for the alloy service (set `ay_manage_nagios`to `true`)
## Repo Documentation ## Repo Documentation
@@ -54,9 +54,6 @@ See the full Puppet documentation including parameters in `docs/index.html`
All dependencies must be included in the catalogue. All dependencies must be included in the catalogue.
- [confdroid_nagios](https://sourcecode.confdroid.com/confdroid/confdroid_nagios) if nagios monitoring is desired
- [puppetlabs/concat](https://forge.puppet.com/modules/puppetlabs/concat) for composing the Alloy configuration
## Deployment ## Deployment
- native Puppet deployment - native Puppet deployment
@@ -69,15 +66,6 @@ node 'example.example.net' {
} }
``` ```
External modules can add log files to Alloy's `path_targets` list with the
`confdroid_alloy::log_targets` defined type:
```puppet
confdroid_alloy::log_targets { 'my_application':
targets => ['/var/log/my_application/*.log', '/var/log/my_application/audit.log'],
}
```
- through Foreman: - through Foreman:
In order to apply parameters through Foreman, the params.pp must be added to the host or host group in question. In order to apply parameters through Foreman, the params.pp must be added to the host or host group in question.

View File

@@ -103,11 +103,6 @@
</li> </li>
<li>
<span class='object_link'><a href="puppet_classes/confdroid_alloy_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_alloy::monitoring::target (puppet_class)">confdroid_alloy::monitoring::target</a></span>
</li>
<li> <li>
<span class='object_link'><a href="puppet_classes/confdroid_alloy_3A_3Aparams.html" title="puppet_classes::confdroid_alloy::params (puppet_class)">confdroid_alloy::params</a></span> <span class='object_link'><a href="puppet_classes/confdroid_alloy_3A_3Aparams.html" title="puppet_classes::confdroid_alloy::params (puppet_class)">confdroid_alloy::params</a></span>
@@ -122,30 +117,6 @@
<h2>Defined Type Listing A-Z</h2>
<table>
<tr>
<td valign='top' width="33%">
<ul id="alpha_C" class="alpha">
<li class="letter">C</li>
<ul>
<li>
<span class='object_link'><a href="puppet_defined_types/confdroid_alloy_3A_3Amonitoring_3A_3Alog_targets.html" title="puppet_defined_types::confdroid_alloy::monitoring::log_targets (puppet_defined_type)">confdroid_alloy::monitoring::log_targets</a></span>
</li>
</ul>
</ul>
</td>
</tr>
</table>

View File

@@ -108,6 +108,8 @@
<p>INSTALLATION</p> <p>INSTALLATION</p>
<ul><li> <ul><li>
<p>installs alloy binaries</p> <p>installs alloy binaries</p>
</li><li>
<p>installs node exporter (optional, set <code>ay_manage_ne</code>to <code>true</code>)</p>
</li></ul> </li></ul>
<p>CONFIGURATION</p> <p>CONFIGURATION</p>
@@ -119,8 +121,6 @@
<p>manages log rotation for rsyslog to allow adm membership</p> <p>manages log rotation for rsyslog to allow adm membership</p>
</li><li> </li><li>
<p>manage service</p> <p>manage service</p>
</li><li>
<p>optional: include nagios target for the alloy service (set <code>ay_manage_nagios</code>to <code>true</code>)</p>
</li></ul> </li></ul>
<h2 id="label-Repo+Documentation">Repo Documentation</h2> <h2 id="label-Repo+Documentation">Repo Documentation</h2>
@@ -130,11 +130,6 @@
<h2 id="label-Dependencies">Dependencies</h2> <h2 id="label-Dependencies">Dependencies</h2>
<p>All dependencies must be included in the catalogue.</p> <p>All dependencies must be included in the catalogue.</p>
<ul><li>
<p><a href="https://sourcecode.confdroid.com/confdroid/confdroid_nagios">confdroid_nagios</a> if nagios monitoring is desired</p>
</li><li>
<p><a href="https://forge.puppet.com/modules/puppetlabs/concat">puppetlabs/concat</a> for composing the Alloy configuration</p>
</li></ul>
<h2 id="label-Deployment">Deployment</h2> <h2 id="label-Deployment">Deployment</h2>
<ul><li> <ul><li>
@@ -147,13 +142,6 @@
include confdroid_alloy include confdroid_alloy
} }
</code></pre> </code></pre>
<p>External modules can add log files to Alloy’s <code>path_targets</code> list with the <code>confdroid_alloy::log_targets</code> defined type:</p>
<pre class="code ruby"><code class="ruby">confdroid_alloy::log_targets { &#39;my_application&#39;:
targets =&gt; [&#39;/var/log/my_application/*.log&#39;, &#39;/var/log/my_application/audit.log&#39;],
}
</code></pre>
<ul><li> <ul><li>
<p>through Foreman:</p> <p>through Foreman:</p>
</li></ul> </li></ul>

View File

@@ -108,6 +108,8 @@
<p>INSTALLATION</p> <p>INSTALLATION</p>
<ul><li> <ul><li>
<p>installs alloy binaries</p> <p>installs alloy binaries</p>
</li><li>
<p>installs node exporter (optional, set <code>ay_manage_ne</code>to <code>true</code>)</p>
</li></ul> </li></ul>
<p>CONFIGURATION</p> <p>CONFIGURATION</p>
@@ -119,8 +121,6 @@
<p>manages log rotation for rsyslog to allow adm membership</p> <p>manages log rotation for rsyslog to allow adm membership</p>
</li><li> </li><li>
<p>manage service</p> <p>manage service</p>
</li><li>
<p>optional: include nagios target for the alloy service (set <code>ay_manage_nagios</code>to <code>true</code>)</p>
</li></ul> </li></ul>
<h2 id="label-Repo+Documentation">Repo Documentation</h2> <h2 id="label-Repo+Documentation">Repo Documentation</h2>
@@ -130,11 +130,6 @@
<h2 id="label-Dependencies">Dependencies</h2> <h2 id="label-Dependencies">Dependencies</h2>
<p>All dependencies must be included in the catalogue.</p> <p>All dependencies must be included in the catalogue.</p>
<ul><li>
<p><a href="https://sourcecode.confdroid.com/confdroid/confdroid_nagios">confdroid_nagios</a> if nagios monitoring is desired</p>
</li><li>
<p><a href="https://forge.puppet.com/modules/puppetlabs/concat">puppetlabs/concat</a> for composing the Alloy configuration</p>
</li></ul>
<h2 id="label-Deployment">Deployment</h2> <h2 id="label-Deployment">Deployment</h2>
<ul><li> <ul><li>
@@ -147,13 +142,6 @@
include confdroid_alloy include confdroid_alloy
} }
</code></pre> </code></pre>
<p>External modules can add log files to Alloy’s <code>path_targets</code> list with the <code>confdroid_alloy::log_targets</code> defined type:</p>
<pre class="code ruby"><code class="ruby">confdroid_alloy::log_targets { &#39;my_application&#39;:
targets =&gt; [&#39;/var/log/my_application/*.log&#39;, &#39;/var/log/my_application/audit.log&#39;],
}
</code></pre>
<ul><li> <ul><li>
<p>through Foreman:</p> <p>through Foreman:</p>
</li></ul> </li></ul>

View File

@@ -28,10 +28,6 @@
Puppet Classes Puppet Classes
</a></span> </a></span>
<span><a target="_self" href="puppet_defined_type_list.html">
Defined Types
</a></span>
</div> </div>
<div id="search">Search: <input type="text" /></div> <div id="search">Search: <input type="text" /></div>
@@ -89,14 +85,7 @@
</li> </li>
<li id="object_puppet_classes::confdroid_alloy::monitoring::target" class="even"> <li id="object_puppet_classes::confdroid_alloy::params" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_alloy_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_alloy::monitoring::target (puppet_class)">confdroid_alloy::monitoring::target</a></span>
</div>
</li>
<li id="object_puppet_classes::confdroid_alloy::params" class="odd">
<div class="item"> <div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_alloy_3A_3Aparams.html" title="puppet_classes::confdroid_alloy::params (puppet_class)">confdroid_alloy::params</a></span> <span class='object_link'><a href="puppet_classes/confdroid_alloy_3A_3Aparams.html" title="puppet_classes::confdroid_alloy::params (puppet_class)">confdroid_alloy::params</a></span>
</div> </div>

View File

@@ -0,0 +1,121 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Puppet Class: alloy_cd
&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::alloy_cd";
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 (a)</a> &raquo;
<span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo;
<span class="title">alloy_cd</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: alloy_cd</h1>
<div class="box_info">
<dl>
<dt>Defined in:</dt>
<dd>
manifests/init.pp
</dd>
</dl>
</div>
<h2>Summary</h2>
Class initializes the alloy_cd module.
<h2>Overview</h2>
<div class="docstring">
<div class="discussion">
<p>alloy_cd::init.pp Module name: alloy_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</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/init.pp', line 6</span>
class alloy_cd {
include alloy_cd::params
}</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

@@ -0,0 +1,130 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Puppet Class: alloy_cd::main::config
&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::alloy_cd::main::config";
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 (a)</a> &raquo;
<span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo;
<span class="title">alloy_cd::main::config</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: alloy_cd::main::config</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd><span class='object_link'><a href="alloy_cd_3A_3Aparams.html" title="puppet_classes::alloy_cd::params (puppet_class)">alloy_cd::params</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>
manifests/main/config.pp
</dd>
</dl>
</div>
<h2>Summary</h2>
Class manages module logic for the alloy_cd module
<h2>Overview</h2>
<div class="docstring">
<div class="discussion">
<p>alloy_cd::main::config.pp Module name: alloy_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</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/main/config.pp', line 6</span>
class alloy_cd::main::config (
) inherits alloy_cd::params {
include alloy_cd::main::service
}</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

@@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> <title>
Puppet Class: confdroid_alloy::monitoring::target Puppet Class: alloy_cd::main::dirs
&mdash; Documentation by YARD 0.9.36 &mdash; Documentation by YARD 0.9.36
@@ -15,7 +15,7 @@
<link rel="stylesheet" href="../css/common.css" type="text/css" /> <link rel="stylesheet" href="../css/common.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
pathId = "puppet_classes::confdroid_alloy::monitoring::target"; pathId = "puppet_classes::alloy_cd::main::dirs";
relpath = '../'; relpath = '../';
</script> </script>
@@ -36,10 +36,10 @@
<div id="header"> <div id="header">
<div id="menu"> <div id="menu">
<a href="../_index.html">Index (c)</a> &raquo; <a href="../_index.html">Index (a)</a> &raquo;
<span class='title'><span class='object_link'>Puppet Classes</span></span> <span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo; &raquo;
<span class="title">confdroid_alloy::monitoring::target</span> <span class="title">alloy_cd::main::dirs</span>
</div> </div>
@@ -59,31 +59,31 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div id="content"><h1>Puppet Class: confdroid_alloy::monitoring::target</h1> <div id="content"><h1>Puppet Class: alloy_cd::main::dirs</h1>
<div class="box_info"> <div class="box_info">
<dl> <dl>
<dt>Inherits:</dt> <dt>Inherits:</dt>
<dd><span class='object_link'><a href="confdroid_alloy_3A_3Aparams.html" title="puppet_classes::confdroid_alloy::params (puppet_class)">confdroid_alloy::params</a></span></dd> <dd><span class='object_link'><a href="alloy_cd_3A_3Aparams.html" title="puppet_classes::alloy_cd::params (puppet_class)">alloy_cd::params</a></span></dd>
</dl> </dl>
<dl> <dl>
<dt>Defined in:</dt> <dt>Defined in:</dt>
<dd> <dd>
manifests/monitoring/target.pp manifests/main/dirs.pp
</dd> </dd>
</dl> </dl>
</div> </div>
<h2>Summary</h2> <h2>Summary</h2>
class manages exports for nagios monitoring Class manages required directories for the alloy_cd module
<h2>Overview</h2> <h2>Overview</h2>
<div class="docstring"> <div class="docstring">
<div class="discussion"> <div class="discussion">
<p>confdroid_alloy::monitoring::target.pp Module name: confdroid_alloy Author: 12ww1160 (12ww1160@puppetsoft.com)</p> <p>alloy_cd::main::dirs.pp Module name: alloy_cd Author: Arne Teuke (arne_teuke@confdroid.com)</p>
</div> </div>
</div> </div>
@@ -117,28 +117,26 @@
19 19
20 20
21 21
22 22</pre>
23</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/monitoring/target.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/dirs.pp', line 6</span>
class confdroid_alloy::monitoring::target ( class alloy_cd::main::dirs (
) inherits confdroid_alloy::params { ) inherits alloy_cd::params {
if $ay_manage_nagios == true { require alloy_cd::main::install
@@nagios_service { &quot;check_alloy_${fqdn}&quot;:
check_command =&gt; &quot;check_nrpe!check_alloy!${ay_procs_allowed}!alloy&quot;, # main config dir
use =&gt; &#39;generic-service&#39;, file { $ay_main_dir:
host_name =&gt; $fqdn, ensure =&gt; directory,
notification_period =&gt; &#39;24x7&#39;, owner =&gt; &#39;root&#39;,
service_description =&gt; &quot;${fqdn}_check_alloy&quot;, group =&gt; &#39;alloy&#39;,
target =&gt; $ay_target_service, mode =&gt; &#39;0770&#39;,
owner =&gt; &#39;nagios&#39;, selrange =&gt; s0,
group =&gt; &#39;nagios&#39;, selrole =&gt; object_r,
mode =&gt; &#39;0640&#39;, seltype =&gt; etc_t,
contacts =&gt; $ay_target_contacts, seluser =&gt; system_u,
}
} }
}</pre> }</pre>
</td> </td>

View File

@@ -0,0 +1,222 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Puppet Class: alloy_cd::main::files
&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::alloy_cd::main::files";
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 (a)</a> &raquo;
<span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo;
<span class="title">alloy_cd::main::files</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: alloy_cd::main::files</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd><span class='object_link'><a href="alloy_cd_3A_3Aparams.html" title="puppet_classes::alloy_cd::params (puppet_class)">alloy_cd::params</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>
manifests/main/files.pp
</dd>
</dl>
</div>
<h2>Summary</h2>
Class manages required config files for the alloy_cd module
<h2>Overview</h2>
<div class="docstring">
<div class="discussion">
<p>alloy_cd::main::files.pp Module name: alloy_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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/main/files.pp', line 6</span>
class alloy_cd::main::files (
) inherits alloy_cd::params {
require alloy_cd::main::dirs
# Ensure log_targets is always an array
$log_targets_array = Array($alloy_cd::params::ay_log_targets, true)
file { $ay_main_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; etc_t,
seluser =&gt; system_u,
content =&gt; template(&#39;alloy_cd/config.alloy.erb&#39;),
notify =&gt; Service[$ay_service],
}
# manage logrotate for rsyslog to allow adm group membership
file { &#39;/etc/logrotate.d/rsyslog&#39;:
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; etc_t,
seluser =&gt; system_u,
content =&gt; template(&#39;alloy_cd/logrotate.rsyslog.erb&#39;),
}
# manage log file group permissions
file { &#39;/var/log/messages&#39;:
ensure =&gt; file,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;adm&#39;,
mode =&gt; &#39;0640&#39;,
notify =&gt; Service[$ay_service],
}
file { &#39;/var/log/secure&#39;:
ensure =&gt; file,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;adm&#39;,
mode =&gt; &#39;0640&#39;,
notify =&gt; Service[$ay_service],
}
}</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

@@ -0,0 +1,138 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Puppet Class: alloy_cd::main::install
&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::alloy_cd::main::install";
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 (a)</a> &raquo;
<span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo;
<span class="title">alloy_cd::main::install</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: alloy_cd::main::install</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd><span class='object_link'><a href="alloy_cd_3A_3Aparams.html" title="puppet_classes::alloy_cd::params (puppet_class)">alloy_cd::params</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>
manifests/main/install.pp
</dd>
</dl>
</div>
<h2>Summary</h2>
Class installs packages for the alloy_cd module
<h2>Overview</h2>
<div class="docstring">
<div class="discussion">
<p>alloy_cd::main::install.pp Module name: alloy_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</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/main/install.pp', line 6</span>
class alloy_cd::main::install (
) inherits alloy_cd::params {
require alloy_cd::main::yumrepo
package { $reqpackages:
ensure =&gt; $pkg_ensure,
}
}</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

@@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> <title>
Defined Type: confdroid_alloy::monitoring::log_targets Puppet Class: alloy_cd::main::service
&mdash; Documentation by YARD 0.9.36 &mdash; Documentation by YARD 0.9.36
@@ -15,7 +15,7 @@
<link rel="stylesheet" href="../css/common.css" type="text/css" /> <link rel="stylesheet" href="../css/common.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
pathId = "puppet_defined_types::confdroid_alloy::monitoring::log_targets"; pathId = "puppet_classes::alloy_cd::main::service";
relpath = '../'; relpath = '../';
</script> </script>
@@ -28,7 +28,7 @@
</head> </head>
<body> <body>
<div class="nav_wrap"> <div class="nav_wrap">
<iframe id="nav" src="../puppet_defined_type_list.html?1"></iframe> <iframe id="nav" src="../puppet_class_list.html?1"></iframe>
<div id="resizer"></div> <div id="resizer"></div>
</div> </div>
@@ -36,10 +36,10 @@
<div id="header"> <div id="header">
<div id="menu"> <div id="menu">
<a href="../_index.html">Index (c)</a> &raquo; <a href="../_index.html">Index (a)</a> &raquo;
<span class='title'><span class='object_link'>Defined Types</span></span> <span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo; &raquo;
<span class="title">confdroid_alloy::monitoring::log_targets</span> <span class="title">alloy_cd::main::service</span>
</div> </div>
@@ -59,24 +59,31 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div id="content"><h1>Defined Type: confdroid_alloy::monitoring::log_targets</h1> <div id="content"><h1>Puppet Class: alloy_cd::main::service</h1>
<div class="box_info"> <div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd><span class='object_link'><a href="alloy_cd_3A_3Aparams.html" title="puppet_classes::alloy_cd::params (puppet_class)">alloy_cd::params</a></span></dd>
</dl>
<dl> <dl>
<dt>Defined in:</dt> <dt>Defined in:</dt>
<dd> <dd>
manifests/monitoring/log_targets.pp manifests/main/service.pp
</dd> </dd>
</dl> </dl>
</div> </div>
<h2>Summary</h2> <h2>Summary</h2>
Adds log file targets to the Alloy configuration. Class manages the alloy service
<h2>Overview</h2> <h2>Overview</h2>
<div class="docstring"> <div class="docstring">
<div class="discussion"> <div class="discussion">
<p>confdroid_alloy::monitoring::log_targets.pp Module name: confdroid_alloy</p> <p>alloy_cd::main::service.pp Module name: alloy_cd Author: Arne Teuke (arne_teuke@confdroid.com)</p>
</div> </div>
</div> </div>
@@ -84,29 +91,7 @@
<div class="tags"> <div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>targets</span>
<span class='type'>(<tt>Array[String]</tt>)</span>
<em class="default">(defaults to: <tt>[]</tt>)</em>
&mdash;
<div class='inline'>
<p>Paths to log files to scrape.</p>
</div>
</li>
</ul>
</div><div class="method_details_list"> </div><div class="method_details_list">
@@ -127,27 +112,21 @@
14 14
15 15
16 16
17 17</pre>
18
19
20</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/monitoring/log_targets.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/service.pp', line 6</span>
define confdroid_alloy::monitoring::log_targets ( class alloy_cd::main::service (
Array[String] $targets = [], ) inherits alloy_cd::params {
require alloy_cd::main::files
) { service { $ay_service:
if $confdroid_alloy::params::ay_manage_loki == true and $targets != [] { ensure =&gt; running,
$log_targets_array = $targets hasstatus =&gt; true,
hasrestart =&gt; true,
concat::fragment { &quot;log_targets_${name}&quot;: enable =&gt; true,
target =&gt; $confdroid_alloy::params::ay_main_file,
content =&gt; template(&#39;confdroid_alloy/log_targets.alloy.erb&#39;),
order =&gt; &#39;020&#39;,
}
} }
}</pre> }</pre>
</td> </td>

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> <title>
Defined Type: confdroid_alloy::log_targets Puppet Class: alloy_cd::main::yumrepo
&mdash; Documentation by YARD 0.9.36 &mdash; Documentation by YARD 0.9.36
@@ -15,7 +15,7 @@
<link rel="stylesheet" href="../css/common.css" type="text/css" /> <link rel="stylesheet" href="../css/common.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
pathId = "puppet_defined_types::confdroid_alloy::log_targets"; pathId = "puppet_classes::alloy_cd::main::yumrepo";
relpath = '../'; relpath = '../';
</script> </script>
@@ -28,7 +28,7 @@
</head> </head>
<body> <body>
<div class="nav_wrap"> <div class="nav_wrap">
<iframe id="nav" src="../puppet_defined_type_list.html?1"></iframe> <iframe id="nav" src="../puppet_class_list.html?1"></iframe>
<div id="resizer"></div> <div id="resizer"></div>
</div> </div>
@@ -36,10 +36,10 @@
<div id="header"> <div id="header">
<div id="menu"> <div id="menu">
<a href="../_index.html">Index (c)</a> &raquo; <a href="../_index.html">Index (a)</a> &raquo;
<span class='title'><span class='object_link'>Defined Types</span></span> <span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo; &raquo;
<span class="title">confdroid_alloy::log_targets</span> <span class="title">alloy_cd::main::yumrepo</span>
</div> </div>
@@ -59,24 +59,31 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div id="content"><h1>Defined Type: confdroid_alloy::log_targets</h1> <div id="content"><h1>Puppet Class: alloy_cd::main::yumrepo</h1>
<div class="box_info"> <div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd><span class='object_link'><a href="alloy_cd_3A_3Aparams.html" title="puppet_classes::alloy_cd::params (puppet_class)">alloy_cd::params</a></span></dd>
</dl>
<dl> <dl>
<dt>Defined in:</dt> <dt>Defined in:</dt>
<dd> <dd>
manifests/log_targets.pp manifests/main/yumrepo.pp
</dd> </dd>
</dl> </dl>
</div> </div>
<h2>Summary</h2> <h2>Summary</h2>
Adds log file targets to the Alloy configuration. class install yum repos for the alloy_cd module
<h2>Overview</h2> <h2>Overview</h2>
<div class="docstring"> <div class="docstring">
<div class="discussion"> <div class="discussion">
<p>confdroid_alloy::log_targets.pp Module name: confdroid_alloy</p> <p>alloy_cd::main::yumrepo.pp Module name: alloy_cd Author: Arne Teuke (arne_teuke@confdroid.com)</p>
</div> </div>
</div> </div>
@@ -84,29 +91,7 @@
<div class="tags"> <div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>targets</span>
<span class='type'>(<tt>Array[String]</tt>)</span>
<em class="default">(defaults to: <tt>[]</tt>)</em>
&mdash;
<div class='inline'>
<p>Paths to log files to scrape.</p>
</div>
</li>
</ul>
</div><div class="method_details_list"> </div><div class="method_details_list">
@@ -133,21 +118,21 @@
20</pre> 20</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/log_targets.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/yumrepo.pp', line 6</span>
define confdroid_alloy::log_targets ( class alloy_cd::main::yumrepo (
Array[String] $targets = [], ) inherits alloy_cd::params {
# test
) { yumrepo { &#39;grafana&#39;:
if $confdroid_alloy::params::ay_manage_loki == true and $targets != [] { ensure =&gt; &#39;present&#39;,
$log_targets_array = $targets name =&gt; &#39;grafana&#39;,
descr =&gt; &#39;grafana&#39;,
concat::fragment { &quot;log_targets_${name}&quot;: baseurl =&gt; &#39;https://packages.grafana.com/oss/rpm&#39;,
target =&gt; $confdroid_alloy::params::ay_main_file, gpgkey =&gt; &#39;https://packages.grafana.com/gpg.key&#39;,
content =&gt; template(&#39;confdroid_alloy/log_targets.alloy.erb&#39;), enabled =&gt; &#39;1&#39;,
order =&gt; &#39;020&#39;, gpgcheck =&gt; &#39;1&#39;,
} target =&gt; &#39;/etc/yum.repo.d/grafana.repo&#39;,
} }
}</pre> }</pre>
</td> </td>

View File

@@ -0,0 +1,382 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Puppet Class: alloy_cd::params
&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::alloy_cd::params";
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 (a)</a> &raquo;
<span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo;
<span class="title">alloy_cd::params</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: alloy_cd::params</h1>
<div class="box_info">
<dl>
<dt>Inherited by:</dt>
<dd>
<span class='object_link'><a href="alloy_cd_3A_3Amain_3A_3Adirs.html" title="puppet_classes::alloy_cd::main::dirs (puppet_class)">alloy_cd::main::dirs</a></span><br/>
<span class='object_link'><a href="alloy_cd_3A_3Amain_3A_3Afiles.html" title="puppet_classes::alloy_cd::main::files (puppet_class)">alloy_cd::main::files</a></span><br/>
<span class='object_link'><a href="alloy_cd_3A_3Amain_3A_3Aconfig.html" title="puppet_classes::alloy_cd::main::config (puppet_class)">alloy_cd::main::config</a></span><br/>
<span class='object_link'><a href="alloy_cd_3A_3Amain_3A_3Ainstall.html" title="puppet_classes::alloy_cd::main::install (puppet_class)">alloy_cd::main::install</a></span><br/>
<span class='object_link'><a href="alloy_cd_3A_3Amain_3A_3Aservice.html" title="puppet_classes::alloy_cd::main::service (puppet_class)">alloy_cd::main::service</a></span><br/>
<span class='object_link'><a href="alloy_cd_3A_3Amain_3A_3Ayumrepo.html" title="puppet_classes::alloy_cd::main::yumrepo (puppet_class)">alloy_cd::main::yumrepo</a></span><br/>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>
manifests/params.pp
</dd>
</dl>
</div>
<h2>Summary</h2>
Class contains all parameters for the alloy_cd module.
<h2>Overview</h2>
<div class="docstring">
<div class="discussion">
<p>alloy_cd::params.pp Module name: alloy_cd Author: Arne Teuke (arne_teuke@confdroid.com)</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>reqpackages</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;alloy&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>which packages to install</p>
</div>
</li>
<li>
<span class='name'>pkg_ensure</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;latest&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>‘latest’ or ‘present’</p>
</div>
</li>
<li>
<span class='name'>ay_loki_url</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;https://loki.example.net/loki/api/v1/push&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the url where alloy will send logs to.</p>
</div>
</li>
<li>
<span class='name'>ay_loki_username</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;loki_user&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the username to logon to loki</p>
</div>
</li>
<li>
<span class='name'>ay_loki_userpass</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;loki_pass&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the password to logon to loki</p>
</div>
</li>
<li>
<span class='name'>ay_manage_loki</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>true</tt>)</em>
&mdash;
<div class='inline'>
<p>whether to manage log forwarding to loki</p>
</div>
</li>
<li>
<span class='name'>ay_manage_prom</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>true</tt>)</em>
&mdash;
<div class='inline'>
<p>whether to manage metric forwarding</p>
</div>
</li>
<li>
<span class='name'>ay_manage_ne</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 metric forwarding for the node exporter (external)</p>
</div>
</li>
<li>
<span class='name'>ay_prom_url</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;https://prometheus.example.net/api/v1/write&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the url where alloy will send metrics</p>
</div>
</li>
<li>
<span class='name'>ay_log_targets</span>
<span class='type'>(<tt>Array</tt>)</span>
<em class="default">(defaults to: <tt>[&#39;/var/log/messages&#39;,&#39;/var/log/secure&#39;,]</tt>)</em>
&mdash;
<div class='inline'>
<p>the logging targets</p>
</div>
</li>
</ul>
</div><div class="method_details_list">
<table class="source_code">
<tr>
<td>
<pre class="lines">
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 17</span>
class alloy_cd::params (
String $reqpackages = &#39;alloy&#39;,
String $pkg_ensure = &#39;latest&#39;,
# loki
Boolean $ay_manage_loki = true,
String $ay_loki_url = &#39;https://loki.example.net/loki/api/v1/push&#39;,
String $ay_loki_username = &#39;loki_user&#39;,
String $ay_loki_userpass = &#39;loki_pass&#39;,
Array $ay_log_targets = [&#39;/var/log/messages&#39;,&#39;/var/log/secure&#39;,],
# prometheus
Boolean $ay_manage_prom = true,
String $ay_prom_url = &#39;https://prometheus.example.net/api/v1/write&#39;,
# node exporter (external)
Boolean $ay_manage_ne = false,
) {
# service
$ay_service = &#39;alloy&#39;
# dirs
$ay_main_dir = &#39;/etc/alloy&#39;
# files
$ay_main_file = &quot;${ay_main_dir}/config.alloy&quot;
# includes must be last
include alloy_cd::main::config
}</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

@@ -105,11 +105,7 @@
7 7
8 8
9 9
10 10</pre>
11
12
13
14</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/main/config.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/config.pp', line 6</span>
@@ -118,10 +114,6 @@ class confdroid_alloy::main::config (
) inherits confdroid_alloy::params { ) inherits confdroid_alloy::params {
include confdroid_alloy::main::service include confdroid_alloy::main::service
if $ay_manage_nagios == true {
include confdroid_alloy::monitoring::target
}
}</pre> }</pre>
</td> </td>
</tr> </tr>

View File

@@ -151,25 +151,7 @@
53 53
54 54
55 55
56 56</pre>
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/main/files.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/files.pp', line 6</span>
@@ -179,10 +161,11 @@ class confdroid_alloy::main::files (
) inherits confdroid_alloy::params { ) inherits confdroid_alloy::params {
require confdroid_alloy::main::dirs require confdroid_alloy::main::dirs
# Ensure log_targets is always an array
$log_targets_array = Array($confdroid_alloy::params::ay_log_targets, true) $log_targets_array = Array($confdroid_alloy::params::ay_log_targets, true)
concat { $ay_main_file: file { $ay_main_file:
ensure =&gt; present, ensure =&gt; file,
owner =&gt; &#39;root&#39;, owner =&gt; &#39;root&#39;,
group =&gt; &#39;root&#39;, group =&gt; &#39;root&#39;,
mode =&gt; &#39;0644&#39;, mode =&gt; &#39;0644&#39;,
@@ -190,29 +173,10 @@ class confdroid_alloy::main::files (
selrole =&gt; object_r, selrole =&gt; object_r,
seltype =&gt; etc_t, seltype =&gt; etc_t,
seluser =&gt; system_u, seluser =&gt; system_u,
content =&gt; template(&#39;confdroid_alloy/config.alloy.erb&#39;),
notify =&gt; Service[$ay_service], notify =&gt; Service[$ay_service],
} }
concat::fragment { &#39;confdroid_alloy_config_header&#39;:
target =&gt; $ay_main_file,
content =&gt; template(&#39;confdroid_alloy/config.alloy.erb&#39;),
order =&gt; &#39;001&#39;,
}
if $ay_manage_loki == true {
concat::fragment { &#39;confdroid_alloy_log_targets_default&#39;:
target =&gt; $ay_main_file,
content =&gt; template(&#39;confdroid_alloy/log_targets.alloy.erb&#39;),
order =&gt; &#39;010&#39;,
}
}
concat::fragment { &#39;confdroid_alloy_config_tail&#39;:
target =&gt; $ay_main_file,
content =&gt; template(&#39;confdroid_alloy/config.alloy.tail.erb&#39;),
order =&gt; &#39;999&#39;,
}
# manage logrotate for rsyslog to allow adm group membership # manage logrotate for rsyslog to allow adm group membership
file { &#39;/etc/logrotate.d/rsyslog&#39;: file { &#39;/etc/logrotate.d/rsyslog&#39;:
ensure =&gt; file, ensure =&gt; file,

View File

@@ -79,8 +79,6 @@
<span class='object_link'><a href="confdroid_alloy_3A_3Amain_3A_3Ayumrepo.html" title="puppet_classes::confdroid_alloy::main::yumrepo (puppet_class)">confdroid_alloy::main::yumrepo</a></span><br/> <span class='object_link'><a href="confdroid_alloy_3A_3Amain_3A_3Ayumrepo.html" title="puppet_classes::confdroid_alloy::main::yumrepo (puppet_class)">confdroid_alloy::main::yumrepo</a></span><br/>
<span class='object_link'><a href="confdroid_alloy_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_alloy::monitoring::target (puppet_class)">confdroid_alloy::monitoring::target</a></span><br/>
</dd> </dd>
</dl> </dl>
@@ -236,6 +234,24 @@
</li> </li>
<li>
<span class='name'>ay_manage_ne</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 metric forwarding for the node exporter (external)</p>
</div>
</li>
<li> <li>
<span class='name'>ay_prom_url</span> <span class='name'>ay_prom_url</span>
@@ -268,168 +284,6 @@
&mdash; &mdash;
<div class='inline'> <div class='inline'>
<p>the logging targets</p> <p>the logging targets</p>
</div>
</li>
<li>
<span class='name'>ay_prom_honor_timestamps</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>true</tt>)</em>
&mdash;
<div class='inline'>
<p>whether to honor timestamps in prometheus metrics</p>
</div>
</li>
<li>
<span class='name'>ay_prom_track_timestamps_staleness</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>true</tt>)</em>
&mdash;
<div class='inline'>
<p>whether to track timestamps staleness in prometheus metrics</p>
</div>
</li>
<li>
<span class='name'>ay_prom_max_shards</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;10&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the maximum number of shards to use for prometheus metrics</p>
</div>
</li>
<li>
<span class='name'>ay_prom_max_samples_per_send</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;2000&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the maximum number of samples to send</p>
</div>
</li>
<li>
<span class='name'>ay_prom_batch_send_deadline</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;5s&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the maximum time to wait before sending</p>
</div>
</li>
<li>
<span class='name'>ay_manage_nagios</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 nagios service exports</p>
</div>
</li>
<li>
<span class='name'>ay_target_service</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;/etc/nagios/conf.d/alloy_service.cfg&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the target file for nagios service exports</p>
</div>
</li>
<li>
<span class='name'>ay_target_contacts</span>
<span class='type'>(<tt>Array</tt>)</span>
<em class="default">(defaults to: <tt>[&#39;nagiosadmin&#39;]</tt>)</em>
&mdash;
<div class='inline'>
<p>the contacts for nagios service exports</p>
</div>
</li>
<li>
<span class='name'>ay_procs_allowed</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1:&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the allowed number of processes for nagios service exports</p>
</div> </div>
</li> </li>
@@ -445,6 +299,15 @@
<pre class="lines"> <pre class="lines">
17
18
19
20
21
22
23
24
25
26 26
27 27
28 28
@@ -467,62 +330,31 @@
45 45
46 46
47 47
48 48</pre>
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 26</span> <pre class="code"><span class="info file"># File 'manifests/params.pp', line 17</span>
class confdroid_alloy::params ( class confdroid_alloy::params (
String $ay_reqpackages = &#39;alloy&#39;, String $ay_reqpackages = &#39;alloy&#39;,
String $ay_pkg_ensure = &#39;latest&#39;, String $ay_pkg_ensure = &#39;latest&#39;,
# loki # loki
Boolean $ay_manage_loki = true, Boolean $ay_manage_loki = true,
String $ay_loki_url = &#39;https://loki.example.net/loki/api/v1/push&#39;, String $ay_loki_url = &#39;https://loki.example.net/loki/api/v1/push&#39;,
String $ay_loki_username = &#39;loki_user&#39;, String $ay_loki_username = &#39;loki_user&#39;,
String $ay_loki_userpass = &#39;loki_pass&#39;, String $ay_loki_userpass = &#39;loki_pass&#39;,
Array $ay_log_targets = [&#39;/var/log/messages&#39;,&#39;/var/log/secure&#39;,], Array $ay_log_targets = [&#39;/var/log/messages&#39;,&#39;/var/log/secure&#39;,],
# prometheus # prometheus
Boolean $ay_manage_prom = true, Boolean $ay_manage_prom = true,
String $ay_prom_url = &#39;https://prometheus.example.net/api/v1/write&#39;, String $ay_prom_url = &#39;https://prometheus.example.net/api/v1/write&#39;,
Boolean $ay_prom_honor_timestamps = true,
Boolean $ay_prom_track_timestamps_staleness = true,
String $ay_prom_max_shards = &#39;10&#39;,
String $ay_prom_max_samples_per_send = &#39;2000&#39;,
String $ay_prom_batch_send_deadline = &#39;5s&#39;,
# nagios # node exporter (external)
Boolean $ay_manage_nagios = false, Boolean $ay_manage_ne = false,
String $ay_target_service = &#39;/etc/nagios/conf.d/alloy_service.cfg&#39;,
Array $ay_target_contacts = [&#39;nagiosadmin&#39;],
String $ay_procs_allowed = &#39;1:&#39;
) { ) {
# defaults
$fqdn = $facts[&#39;networking&#39;][&#39;fqdn&#39;]
# service # service
$ay_service = &#39;alloy&#39; $ay_service = &#39;alloy&#39;

View File

@@ -1,54 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8" />
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" />
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
<title>Defined Type List</title>
<base id="base_target" target="_parent" />
</head>
<body>
<div id="content">
<div class="fixed_header">
<h1 id="full_list_header">Defined Type List</h1>
<div id="full_list_nav">
<span><a target="_self" href="puppet_class_list.html">
Puppet Classes
</a></span>
<span><a target="_self" href="puppet_defined_type_list.html">
Defined Types
</a></span>
</div>
<div id="search">Search: <input type="text" /></div>
</div>
<ul id="full_list" class="puppet_defined_type">
<li id="object_puppet_defined_types::confdroid_alloy::monitoring::log_targets" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_defined_types/confdroid_alloy_3A_3Amonitoring_3A_3Alog_targets.html" title="puppet_defined_types::confdroid_alloy::monitoring::log_targets (puppet_defined_type)">confdroid_alloy::monitoring::log_targets</a></span>
</div>
</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,8 +7,4 @@ class confdroid_alloy::main::config (
) inherits confdroid_alloy::params { ) inherits confdroid_alloy::params {
include confdroid_alloy::main::service include confdroid_alloy::main::service
if $ay_manage_nagios == true {
include confdroid_alloy::monitoring::target
}
} }

View File

@@ -8,10 +8,11 @@ class confdroid_alloy::main::files (
) inherits confdroid_alloy::params { ) inherits confdroid_alloy::params {
require confdroid_alloy::main::dirs require confdroid_alloy::main::dirs
# Ensure log_targets is always an array
$log_targets_array = Array($confdroid_alloy::params::ay_log_targets, true) $log_targets_array = Array($confdroid_alloy::params::ay_log_targets, true)
concat { $ay_main_file: file { $ay_main_file:
ensure => present, ensure => file,
owner => 'root', owner => 'root',
group => 'root', group => 'root',
mode => '0644', mode => '0644',
@@ -19,29 +20,10 @@ class confdroid_alloy::main::files (
selrole => object_r, selrole => object_r,
seltype => etc_t, seltype => etc_t,
seluser => system_u, seluser => system_u,
content => template('confdroid_alloy/config.alloy.erb'),
notify => Service[$ay_service], notify => Service[$ay_service],
} }
concat::fragment { 'confdroid_alloy_config_header':
target => $ay_main_file,
content => template('confdroid_alloy/config.alloy.erb'),
order => '001',
}
if $ay_manage_loki == true {
concat::fragment { 'confdroid_alloy_log_targets_default':
target => $ay_main_file,
content => template('confdroid_alloy/log_targets.alloy.erb'),
order => '010',
}
}
concat::fragment { 'confdroid_alloy_config_tail':
target => $ay_main_file,
content => template('confdroid_alloy/config.alloy.tail.erb'),
order => '999',
}
# manage logrotate for rsyslog to allow adm group membership # manage logrotate for rsyslog to allow adm group membership
file { '/etc/logrotate.d/rsyslog': file { '/etc/logrotate.d/rsyslog':
ensure => file, ensure => file,

View File

@@ -1,20 +0,0 @@
## confdroid_alloy::monitoring::log_targets.pp
# Module name: confdroid_alloy
# @summary Adds log file targets to the Alloy configuration.
# @param [Array[String]] targets Paths to log files to scrape.
###############################################################################
define confdroid_alloy::monitoring::log_targets (
Array[String] $targets = [],
) {
if $confdroid_alloy::params::ay_manage_loki == true and $targets != [] {
$log_targets_array = $targets
concat::fragment { "log_targets_${name}":
target => $confdroid_alloy::params::ay_main_file,
content => template('confdroid_alloy/log_targets.alloy.erb'),
order => '020',
}
}
}

View File

@@ -1,23 +0,0 @@
## confdroid_alloy::monitoring::target.pp
# Module name: confdroid_alloy
# Author: 12ww1160 (12ww1160@puppetsoft.com)
# @summary class manages exports for nagios monitoring
##############################################################################
class confdroid_alloy::monitoring::target (
) inherits confdroid_alloy::params {
if $ay_manage_nagios == true {
@@nagios_service { "check_alloy_${fqdn}":
check_command => "check_nrpe!check_alloy!${ay_procs_allowed}!alloy",
use => 'generic-service',
host_name => $fqdn,
notification_period => '24x7',
service_description => "${fqdn}_check_alloy",
target => $ay_target_service,
owner => 'nagios',
group => 'nagios',
mode => '0640',
contacts => $ay_target_contacts,
}
}
}

View File

@@ -8,52 +8,32 @@
# @param [String] ay_loki_userpass the password to logon to loki # @param [String] ay_loki_userpass the password to logon to loki
# @param [Boolean] ay_manage_loki whether to manage log forwarding to loki # @param [Boolean] ay_manage_loki whether to manage log forwarding to loki
# @param [Boolean] ay_manage_prom whether to manage metric forwarding # @param [Boolean] ay_manage_prom whether to manage metric forwarding
# @param [Boolean] ay_manage_ne whether to manage metric forwarding for
# the node exporter (external)
# @param [String] ay_prom_url the url where alloy will send metrics # @param [String] ay_prom_url the url where alloy will send metrics
# @param [Array] ay_log_targets the logging targets # @param [Array] ay_log_targets the logging targets
# @param [Boolean] ay_prom_honor_timestamps whether to honor
# timestamps in prometheus metrics
# @param [Boolean] ay_prom_track_timestamps_staleness whether to track timestamps
# staleness in prometheus metrics
# @param [String] ay_prom_max_shards the maximum number of shards to use for prometheus metrics
# @param [String] ay_prom_max_samples_per_send the maximum number of samples to send
# @param [String] ay_prom_batch_send_deadline the maximum time to wait before sending
# @param [Boolean] ay_manage_nagios whether to manage nagios service exports
# @param [String] ay_target_service the target file for nagios service exports
# @param [Array] ay_target_contacts the contacts for nagios service exports
# @param [String] ay_procs_allowed the allowed number of processes for nagios service exports
# @summary Class contains all parameters for the confdroid_alloy module. # @summary Class contains all parameters for the confdroid_alloy module.
############################################################################## ##############################################################################
class confdroid_alloy::params ( class confdroid_alloy::params (
String $ay_reqpackages = 'alloy', String $ay_reqpackages = 'alloy',
String $ay_pkg_ensure = 'latest', String $ay_pkg_ensure = 'latest',
# loki # loki
Boolean $ay_manage_loki = true, Boolean $ay_manage_loki = true,
String $ay_loki_url = 'https://loki.example.net/loki/api/v1/push', String $ay_loki_url = 'https://loki.example.net/loki/api/v1/push',
String $ay_loki_username = 'loki_user', String $ay_loki_username = 'loki_user',
String $ay_loki_userpass = 'loki_pass', String $ay_loki_userpass = 'loki_pass',
Array $ay_log_targets = ['/var/log/messages','/var/log/secure',], Array $ay_log_targets = ['/var/log/messages','/var/log/secure',],
# prometheus # prometheus
Boolean $ay_manage_prom = true, Boolean $ay_manage_prom = true,
String $ay_prom_url = 'https://prometheus.example.net/api/v1/write', String $ay_prom_url = 'https://prometheus.example.net/api/v1/write',
Boolean $ay_prom_honor_timestamps = true,
Boolean $ay_prom_track_timestamps_staleness = true,
String $ay_prom_max_shards = '10',
String $ay_prom_max_samples_per_send = '2000',
String $ay_prom_batch_send_deadline = '5s',
# nagios # node exporter (external)
Boolean $ay_manage_nagios = false, Boolean $ay_manage_ne = false,
String $ay_target_service = '/etc/nagios/conf.d/alloy_service.cfg',
Array $ay_target_contacts = ['nagiosadmin'],
String $ay_procs_allowed = '1:'
) { ) {
# defaults
$fqdn = $facts['networking']['fqdn']
# service # service
$ay_service = 'alloy' $ay_service = 'alloy'

View File

@@ -18,4 +18,66 @@ loki.process "alloy" {
// Define file discovery for your logs // Define file discovery for your logs
local.file_match "system_logs" { local.file_match "system_logs" {
path_targets = [ path_targets = [
<% @log_targets_array.each do |target| -%>
{__path__ = "<%= target %>"},
<% end -%> <% end -%>
]
sync_period = "5s"
}
// Scrape the logs from the matched files
loki.source.file "system_logs" {
targets = local.file_match.system_logs.targets
forward_to = [loki.process.syslog.receiver]
}
loki.process "syslog" {
stage.static_labels {
values = {
fqdn = constants.hostname,
service = "linux_logs",
}
}
forward_to = [loki.write.loki.receiver]
}
loki.write "loki" {
endpoint {
url = "<%= @ay_loki_url %>"
basic_auth {
username = "<%= @ay_loki_username %>"
password = "<%= @ay_loki_userpass %>"
}
}
}
<% end -%>
<% if @ay_manage_prom == true -%>
// Metrics collection
prometheus.exporter.unix "system_metrics" {
include_exporter_metrics = true
disable_collectors = ["mdadm"]
}
prometheus.scrape "scrape_system" {
targets = prometheus.exporter.unix.system_metrics.targets
forward_to = [prometheus.remote_write.prometheus.receiver]
scrape_interval = "15s"
}
<% if @ay_manage_ne == true -%>
prometheus.scrape "node_exporter" {
targets = [{ __address__ = "localhost:9100" }]
forward_to = [prometheus.remote_write.prometheus.receiver]
scrape_interval = "15s"
}
<% end -%>
prometheus.remote_write "prometheus" {
endpoint {
url = "<%= @ay_prom_url %>"
basic_auth {
username = "<%= @ay_loki_username %>"
password = "<%= @ay_loki_userpass %>"
}
}
}
<% end %>

View File

@@ -1,82 +0,0 @@
<% if @ay_manage_loki == true -%>
]
sync_period = "5s"
}
// Scrape the logs from the matched files
loki.source.file "system_logs" {
targets = local.file_match.system_logs.targets
forward_to = [loki.process.syslog.receiver]
}
loki.process "syslog" {
stage.static_labels {
values = {
fqdn = constants.hostname,
service = "linux_logs",
}
}
forward_to = [loki.write.loki.receiver]
}
loki.write "loki" {
endpoint {
url = "<%= @ay_loki_url %>"
basic_auth {
username = "<%= @ay_loki_username %>"
password = "<%= @ay_loki_userpass %>"
}
}
}
<% end -%>
<% if @ay_manage_prom == true -%>
// 1. Exporter (or keep your existing node_exporter binary)
prometheus.exporter.unix "node" {
// optional: disable unused collectors
// disable_collectors = ["ipvs", "btrfs", ...]
}
// 2. Relabel the targets so instance = real hostname
discovery.relabel "node_exporter" {
targets = prometheus.exporter.unix.node.targets
rule {
target_label = "instance"
replacement = constants.hostname
}
rule {
target_label = "job"
replacement = "integrations/node_exporter"
}
}
// 3. Scrape the properly labeled targets
prometheus.scrape "node_exporter" {
targets = discovery.relabel.node_exporter.output
forward_to = [prometheus.remote_write.prometheus.receiver]
scrape_interval = "15s"
honor_timestamps = <%= @ay_prom_honor_timestamps %>
track_timestamps_staleness = <%= @ay_prom_track_timestamps_staleness %>
}
prometheus.remote_write "prometheus" {
external_labels = {
// makes every series from this Alloy unmistakably unique
alloy_instance = constants.hostname,
}
endpoint {
url = "<%= @ay_prom_url %>"
basic_auth {
username = "<%= @ay_loki_username %>"
password = "<%= @ay_loki_userpass %>"
}
queue_config {
max_shards = <%= @ay_prom_max_shards %>
max_samples_per_send = <%= @ay_prom_max_samples_per_send %>
batch_send_deadline = "<%= @ay_prom_batch_send_deadline %>"
}
}
}
<% end -%>

View File

@@ -1,3 +0,0 @@
<% @log_targets_array.each do |target| -%>
{__path__ = "<%= target %>"},
<% end -%>