Recommit for updates in build 35
This commit is contained in:
127
Jenkinsfile
vendored
127
Jenkinsfile
vendored
@@ -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_ntp \
|
||||
-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_ntp.git
|
||||
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
|
||||
push master --mirror
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,6 +98,11 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Aloki.html" title="puppet_classes::confdroid_ntp::monitoring::loki (puppet_class)">confdroid_ntp::monitoring::loki</a></span>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_ntp::monitoring::target (puppet_class)">confdroid_ntp::monitoring::target</a></span>
|
||||
|
||||
|
||||
@@ -78,14 +78,21 @@
|
||||
</li>
|
||||
|
||||
|
||||
<li id="object_puppet_classes::confdroid_ntp::monitoring::target" class="odd">
|
||||
<li id="object_puppet_classes::confdroid_ntp::monitoring::loki" class="odd">
|
||||
<div class="item">
|
||||
<span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Aloki.html" title="puppet_classes::confdroid_ntp::monitoring::loki (puppet_class)">confdroid_ntp::monitoring::loki</a></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="object_puppet_classes::confdroid_ntp::monitoring::target" class="even">
|
||||
<div class="item">
|
||||
<span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_ntp::monitoring::target (puppet_class)">confdroid_ntp::monitoring::target</a></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="object_puppet_classes::confdroid_ntp::params" class="even">
|
||||
<li id="object_puppet_classes::confdroid_ntp::params" class="odd">
|
||||
<div class="item">
|
||||
<span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Aparams.html" title="puppet_classes::confdroid_ntp::params (puppet_class)">confdroid_ntp::params</a></span>
|
||||
</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_ntp::main::config (
|
||||
if $cy_manage_nagios == true {
|
||||
include confdroid_ntp::monitoring::target
|
||||
}
|
||||
|
||||
if $cy_manage_loki == true {
|
||||
include confdroid_ntp::monitoring::loki
|
||||
}
|
||||
}</pre>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
138
doc/puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Aloki.html
Normal file
138
doc/puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Aloki.html
Normal 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: confdroid_ntp::monitoring::loki
|
||||
|
||||
— 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_ntp::monitoring::loki";
|
||||
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> »
|
||||
<span class='title'><span class='object_link'>Puppet Classes</span></span>
|
||||
»
|
||||
<span class="title">confdroid_ntp::monitoring::loki</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_ntp::monitoring::loki</h1>
|
||||
<div class="box_info">
|
||||
|
||||
<dl>
|
||||
<dt>Inherits:</dt>
|
||||
<dd><span class='object_link'><a href="confdroid_ntp_3A_3Aparams.html" title="puppet_classes::confdroid_ntp::params (puppet_class)">confdroid_ntp::params</a></span></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>Defined in:</dt>
|
||||
<dd>
|
||||
manifests/monitoring/loki.pp
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h2>Summary</h2>
|
||||
Class manages loki monitoring for the confdroid_ntp services
|
||||
|
||||
<h2>Overview</h2>
|
||||
<div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>confdroid_ntp::monitoring::loki.pp Module name: confdroid_ntp Author: 12ww1160 (12ww1160@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/monitoring/loki.pp', line 6</span>
|
||||
|
||||
class confdroid_ntp::monitoring::loki (
|
||||
|
||||
) inherits confdroid_ntp::params {
|
||||
if $cy_manage_loki == true {
|
||||
confdroid_loki::log_targets { "confdroid_ntp_${fqdn}":
|
||||
log_target => ['/var/log/chrony/*.log'],
|
||||
}
|
||||
}
|
||||
}</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>
|
||||
@@ -77,6 +77,8 @@
|
||||
|
||||
<span class='object_link'><a href="confdroid_ntp_3A_3Amain_3A_3Aservice.html" title="puppet_classes::confdroid_ntp::main::service (puppet_class)">confdroid_ntp::main::service</a></span><br/>
|
||||
|
||||
<span class='object_link'><a href="confdroid_ntp_3A_3Amonitoring_3A_3Aloki.html" title="puppet_classes::confdroid_ntp::monitoring::loki (puppet_class)">confdroid_ntp::monitoring::loki</a></span><br/>
|
||||
|
||||
<span class='object_link'><a href="confdroid_ntp_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_ntp::monitoring::target (puppet_class)">confdroid_ntp::monitoring::target</a></span><br/>
|
||||
|
||||
</dd>
|
||||
@@ -356,6 +358,24 @@
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>List of Nagios contacts for notifications. must exist in Nagios contacts configuration!</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>cy_manage_loki</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>false</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>Whether to manage Loki logging for the module.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@@ -371,7 +391,6 @@
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
@@ -414,10 +433,14 @@
|
||||
67
|
||||
68
|
||||
69
|
||||
70</pre>
|
||||
70
|
||||
71
|
||||
72
|
||||
73
|
||||
74</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 27</span>
|
||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 28</span>
|
||||
|
||||
class confdroid_ntp::params (
|
||||
|
||||
@@ -441,6 +464,9 @@ class confdroid_ntp::params (
|
||||
String $cy_target_service = '/etc/nagios/conf.d/chronyd_service.cfg',
|
||||
Array $cy_target_contacts = ['nagiosadmin'],
|
||||
|
||||
# loki
|
||||
Boolean $cy_manage_loki = false,
|
||||
|
||||
) {
|
||||
# facts
|
||||
$fqdn = $facts['networking']['fqdn']
|
||||
|
||||
Reference in New Issue
Block a user