Compare commits

...

5 Commits

Author SHA1 Message Date
Jenkins Server
322eb50f57 Recommit for updates in build 16 2026-09-07 14:42:13 +02:00
Jenkins Server
777d4d0e91 Merge remote-tracking branch 'origin/master' into jenkins-build-16 2026-09-07 14:41:21 +02:00
aa83361a8e OP#672 update Readme with new feature 2026-09-07 14:40:59 +02:00
c2149834d3 OP#672 update Readme with new feature 2026-09-07 14:39:23 +02:00
Jenkins Server
7bb12d03c5 Recommit for updates in build 15 2026-09-07 14:04:52 +02:00
6 changed files with 37 additions and 131 deletions

127
Jenkinsfile vendored
View File

@@ -1,127 +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_alloy \
-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_alloy.git
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
push master --mirror
'''
}
}
}
}
}
}
}

View File

@@ -44,6 +44,7 @@ CONFIGURATION
- manages the main alloy pipeline for loki and prometheus
- manages log rotation for rsyslog to allow adm membership
- manage service
- optional: include nagios target for the alloy service (set `ay_manage_nagios`to `true`)
## Repo Documentation
@@ -53,6 +54,8 @@ See the full Puppet documentation including parameters in `docs/index.html`
All dependencies must be included in the catalogue.
- [confdroid_nagios](https://sourcecode.confdroid.com/confdroid/confdroid_nagios) if nagios monitoring is desired
## Deployment
- native Puppet deployment

View File

@@ -119,6 +119,8 @@
<p>manages log rotation for rsyslog to allow adm membership</p>
</li><li>
<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>
<h2 id="label-Repo+Documentation">Repo Documentation</h2>
@@ -128,6 +130,9 @@
<h2 id="label-Dependencies">Dependencies</h2>
<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></ul>
<h2 id="label-Deployment">Deployment</h2>
<ul><li>

View File

@@ -119,6 +119,8 @@
<p>manages log rotation for rsyslog to allow adm membership</p>
</li><li>
<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>
<h2 id="label-Repo+Documentation">Repo Documentation</h2>
@@ -128,6 +130,9 @@
<h2 id="label-Dependencies">Dependencies</h2>
<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></ul>
<h2 id="label-Deployment">Deployment</h2>
<ul><li>

View File

@@ -128,7 +128,7 @@ class confdroid_alloy::monitoring::target (
) inherits confdroid_alloy::params {
if $ay_manage_nagios == true {
@@nagios_service { &quot;check_alloy_${fqdn}&quot;:
check_command =&gt; &quot;check_nrpe!check_alloy!${fn_procs_allowed}!alloy-server&quot;,
check_command =&gt; &quot;check_nrpe!check_alloy!${ay_procs_allowed}!alloy&quot;,
use =&gt; &#39;generic-service&#39;,
host_name =&gt; $fqdn,
notification_period =&gt; &#39;24x7&#39;,

View File

@@ -412,6 +412,24 @@
&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:1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the allowed number of processes for nagios service exports</p>
</div>
</li>
@@ -427,7 +445,6 @@
<pre class="lines">
25
26
27
28
@@ -468,10 +485,12 @@
63
64
65
66</pre>
66
67
68</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 25</span>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 26</span>
class confdroid_alloy::params (
@@ -498,6 +517,7 @@ class confdroid_alloy::params (
Boolean $ay_manage_nagios = 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:1&#39;
) {
# defaults