Recommit for updates in build 25

This commit is contained in:
Jenkins Server
2026-09-07 16:44:50 +02:00
parent 702b868d0e
commit 9a6bd98633
9 changed files with 299 additions and 144 deletions

128
Jenkinsfile vendored
View File

@@ -1,128 +0,0 @@
pipeline {
agent {
label 'puppet'
}
post {
always {
deleteDir() /* clean up our workspace */
}
success {
updateGitlabCommitStatus state: 'success'
}
failure {
updateGitlabCommitStatus state: 'failed'
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'support@confdroid.com', sendToIndividuals: true])
}
}
options {
gitLabConnection('gitlab.confdroid.com')
}
stages {
stage('pull master') {
steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
sh '''
git config user.name "Jenkins Server"
git config user.email jenkins@confdroid.com
# Ensure we're on the development branch (triggered by push)
git checkout development
# Create jenkins branch from development
git checkout -b jenkins-build-$BUILD_NUMBER
# Optionally merge master into jenkins to ensure compatibility
git merge origin/master --no-ff || { echo "Merge conflict detected"; exit 1; }
'''
}
}
}
stage('puppet parser') {
steps {
sh '''for file in $(find . -iname \'*.pp\'); do
/opt/puppetlabs/bin/puppet parser validate --color false --render-as s --modulepath=modules $file || exit 1;
done;'''
}
}
stage('check templates') {
steps{
sh '''for file in $(find . -iname \'*.erb\');
do erb -P -x -T "-" $file | ruby -c || exit 1;
done;'''
}
}
stage('puppet-lint') {
steps {
sh '''/usr/local/bin/puppet-lint . \\
--no-variable_scope-check \\
|| { echo "Puppet lint failed"; exit 1; }
'''
}
}
stage('SonarScan') {
steps {
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
sh '''
/opt/sonar-scanner/bin/sonar-scanner \
-Dsonar.projectKey=confdroid_puppet \
-Dsonar.sources=. \
-Dsonar.host.url=https://sonarqube.confdroid.com \
-Dsonar.token=$SONAR_TOKEN
'''
}
}
}
stage('create Puppet documentation') {
steps {
sh '/opt/puppetlabs/bin/puppet strings'
}
}
stage('update repo') {
steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
sh '''
git config user.name "Jenkins Server"
git config user.email jenkins@confdroid.com
git rm -r --cached .vscode || echo "No .vscode to remove from git"
git add -A && git commit -am "Recommit for updates in build $BUILD_NUMBER" || echo "No changes to commit"
git push origin HEAD:master
'''
}
}
}
stage('Mirror to Gitea') {
steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
withCredentials([usernamePassword(
credentialsId: 'Jenkins-gitea',
usernameVariable: 'GITEA_USER',
passwordVariable: 'GITEA_TOKEN')]) {
script {
// Checkout from GitLab (already done implicitly)
sh '''
git checkout master
git pull origin master
git branch -D development
git branch -D jenkins-build-$BUILD_NUMBER
git rm -f Jenkinsfile
git rm -r --cached .vscode || echo "No .vscode to remove from git"
git commit --amend --no-edit --allow-empty
git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_puppet.git
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
push master --mirror
'''
}
}
}
}
}
}
}

View File

@@ -98,6 +98,11 @@
</li>
<li>
<span class='object_link'><a href="puppet_classes/confdroid_puppet_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_puppet::monitoring::target (puppet_class)">confdroid_puppet::monitoring::target</a></span>
</li>
<li>
<span class='object_link'><a href="puppet_classes/confdroid_puppet_3A_3Aparams.html" title="puppet_classes::confdroid_puppet::params (puppet_class)">confdroid_puppet::params</a></span>

View File

@@ -142,7 +142,7 @@
<h3 id="label-Directories-2C+Files+and+Services">Directories, Files and Services</h3>
<ul><li>
<p>manage directories and required files including permissions and selinux context (todo)</p>
<p>manage directories and required files including permissions and selinux context</p>
</li><li>
<p>start services as required</p>
</li></ul>

View File

@@ -142,7 +142,7 @@
<h3 id="label-Directories-2C+Files+and+Services">Directories, Files and Services</h3>
<ul><li>
<p>manage directories and required files including permissions and selinux context (todo)</p>
<p>manage directories and required files including permissions and selinux context</p>
</li><li>
<p>start services as required</p>
</li></ul>

View File

@@ -78,35 +78,42 @@
</li>
<li id="object_puppet_classes::confdroid_puppet::params" class="odd">
<li id="object_puppet_classes::confdroid_puppet::monitoring::target" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_puppet_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_puppet::monitoring::target (puppet_class)">confdroid_puppet::monitoring::target</a></span>
</div>
</li>
<li id="object_puppet_classes::confdroid_puppet::params" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_puppet_3A_3Aparams.html" title="puppet_classes::confdroid_puppet::params (puppet_class)">confdroid_puppet::params</a></span>
</div>
</li>
<li id="object_puppet_classes::confdroid_puppet::puppetdb::dirs" class="even">
<li id="object_puppet_classes::confdroid_puppet::puppetdb::dirs" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_puppet_3A_3Apuppetdb_3A_3Adirs.html" title="puppet_classes::confdroid_puppet::puppetdb::dirs (puppet_class)">confdroid_puppet::puppetdb::dirs</a></span>
</div>
</li>
<li id="object_puppet_classes::confdroid_puppet::puppetdb::files" class="odd">
<li id="object_puppet_classes::confdroid_puppet::puppetdb::files" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_puppet_3A_3Apuppetdb_3A_3Afiles.html" title="puppet_classes::confdroid_puppet::puppetdb::files (puppet_class)">confdroid_puppet::puppetdb::files</a></span>
</div>
</li>
<li id="object_puppet_classes::confdroid_puppet::r10k::install" class="even">
<li id="object_puppet_classes::confdroid_puppet::r10k::install" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_puppet_3A_3Ar10k_3A_3Ainstall.html" title="puppet_classes::confdroid_puppet::r10k::install (puppet_class)">confdroid_puppet::r10k::install</a></span>
</div>
</li>
<li id="object_puppet_classes::confdroid_puppet::server::service" class="odd">
<li id="object_puppet_classes::confdroid_puppet::server::service" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_puppet_3A_3Aserver_3A_3Aservice.html" title="puppet_classes::confdroid_puppet::server::service (puppet_class)">confdroid_puppet::server::service</a></span>
</div>

View File

@@ -83,7 +83,7 @@
<div class="docstring">
<div class="discussion">
<p>confdroid_puppet::main::config.pp Module name: confdroid_puppet Author: Arne Teuke (arne_teuke@confdroid)</p>
<p>confdroid_puppet::main::config.pp Module name: confdroid_puppet Author: 12ww1160 (12ww1160@confdroid.com)</p>
</div>
</div>
@@ -109,7 +109,11 @@
11
12
13
14</pre>
14
15
16
17
18</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/main/config.pp', line 6</span>
@@ -122,6 +126,10 @@ class confdroid_puppet::main::config (
if $pt_use_r10k == true {
include confdroid_puppet::r10k::install
}
if $pt_manage_nagios == true {
include confdroid_puppet::monitoring::target
}
}</pre>
</td>
</tr>

View File

@@ -83,7 +83,7 @@
<div class="docstring">
<div class="discussion">
<p>confdroid_puppet::main::dirs.pp Module name: confdroid_puppet Author: Arne Teuke (arne_teuke@confdroid)</p>
<p>confdroid_puppet::main::dirs.pp Module name: confdroid_puppet Author: 12ww1160 (12ww1160@confdroid.com)</p>
</div>
</div>
@@ -144,7 +144,20 @@
46
47
48
49</pre>
49
50
51
52
53
54
55
56
57
58
59
60
61
62</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/main/dirs.pp', line 6</span>
@@ -191,6 +204,19 @@ class confdroid_puppet::main::dirs (
seltype =&gt; puppet_etc_t,
seluser =&gt; system_u,
}
# code dir
file { $pt_code_dir:
ensure =&gt; directory,
path =&gt; $pt_code_dir,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;root&#39;,
mode =&gt; &#39;0755&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; puppet_etc_t,
seluser =&gt; system_u,
}
}
}</pre>
</td>

View File

@@ -0,0 +1,156 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Puppet Class: confdroid_puppet::monitoring::target
&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::confdroid_puppet::monitoring::target";
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 (c)</a> &raquo;
<span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo;
<span class="title">confdroid_puppet::monitoring::target</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: confdroid_puppet::monitoring::target</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd><span class='object_link'><a href="confdroid_puppet_3A_3Aparams.html" title="puppet_classes::confdroid_puppet::params (puppet_class)">confdroid_puppet::params</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>
manifests/monitoring/target.pp
</dd>
</dl>
</div>
<h2>Summary</h2>
class manages exports for nagios monitoring
<h2>Overview</h2>
<div class="docstring">
<div class="discussion">
<p>confdroid_puppet::monitoring::target.pp Module name: confdroid_puppet Author: 12ww1160 (12ww1160@puppetsoft.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</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/monitoring/target.pp', line 6</span>
class confdroid_puppet::monitoring::target (
) inherits confdroid_puppet::params {
if $pt_manage_nagios == true {
@@nagios_service { &quot;check_puppet_${fqdn}&quot;:
check_command =&gt; &quot;check_nrpe!check_puppet!${pt_procs_allowed}!puppet&quot;,
use =&gt; &#39;generic-service&#39;,
host_name =&gt; $fqdn,
notification_period =&gt; &#39;24x7&#39;,
service_description =&gt; &quot;${fqdn}_check_puppet&quot;,
target =&gt; $pt_target_service,
owner =&gt; &#39;nagios&#39;,
group =&gt; &#39;nagios&#39;,
mode =&gt; &#39;0640&#39;,
contacts =&gt; $pt_target_contacts,
}
}
}</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

@@ -85,6 +85,8 @@
<span class='object_link'><a href="confdroid_puppet_3A_3Afirewall_3A_3Aiptables.html" title="puppet_classes::confdroid_puppet::firewall::iptables (puppet_class)">confdroid_puppet::firewall::iptables</a></span><br/>
<span class='object_link'><a href="confdroid_puppet_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_puppet::monitoring::target (puppet_class)">confdroid_puppet::monitoring::target</a></span><br/>
</dd>
</dl>
@@ -1194,6 +1196,73 @@
</li>
<li>
<span class='name'>pt_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 settings</p>
</div>
</li>
<li>
<span class='name'>pt_target_service</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;/etc/nagios/conf.d/puppet_service.cfg&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the nagios service config file</p>
</div>
</li>
<li>
<span class='name'>pt_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 nagios contacts to notify</p>
</div>
</li>
<li>
<span class='name'>pt_procs_allowed</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1:&#39;</tt>)</em>
</li>
</ul>
@@ -1205,9 +1274,6 @@
<pre class="lines">
69
70
71
72
73
74
@@ -1359,10 +1425,19 @@
220
221
222
223</pre>
223
224
225
226
227
228
229
230
231
232</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 69</span>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 72</span>
class confdroid_puppet::params (
@@ -1439,6 +1514,12 @@ class confdroid_puppet::params (
String $pt_r10k_basedir = &#39;/etc/puppetlabs/code/environments&#39;,
String $pt_r10k_webhook_port = &#39;8085&#39;,
# nagios
Boolean $pt_manage_nagios = false,
String $pt_target_service = &#39;/etc/nagios/conf.d/puppet_service.cfg&#39;,
Array $pt_target_contacts = [&#39;nagiosadmin&#39;],
String $pt_procs_allowed = &#39;1:&#39;
) {
# facts
$fqdn = $facts[&#39;networking&#39;][&#39;fqdn&#39;]