Compare commits
4 Commits
bdee6e9aaa
...
6156b81469
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6156b81469 | ||
|
|
e60e0ea9b9 | ||
| 9c891f058b | |||
|
|
e69d85103f |
124
Jenkinsfile
vendored
124
Jenkinsfile
vendored
@@ -1,124 +0,0 @@
|
|||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
|
|
||||||
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_nrpe \
|
|
||||||
-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 {
|
|
||||||
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_nrpe.git
|
|
||||||
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
|
|
||||||
push master --mirror
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -131,7 +131,21 @@
|
|||||||
33
|
33
|
||||||
34
|
34
|
||||||
35
|
35
|
||||||
36</pre>
|
36
|
||||||
|
37
|
||||||
|
38
|
||||||
|
39
|
||||||
|
40
|
||||||
|
41
|
||||||
|
42
|
||||||
|
43
|
||||||
|
44
|
||||||
|
45
|
||||||
|
46
|
||||||
|
47
|
||||||
|
48
|
||||||
|
49
|
||||||
|
50</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>
|
||||||
@@ -166,6 +180,20 @@ class confdroid_nrpe::main::dirs (
|
|||||||
seltype => var_run_t,
|
seltype => var_run_t,
|
||||||
seluser => system_u,
|
seluser => system_u,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $ne_enable_ssl {
|
||||||
|
file { $ne_servercert_dir:
|
||||||
|
ensure => directory,
|
||||||
|
path => $ne_servercert_dir,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0755',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => cert_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
}
|
||||||
}</pre>
|
}</pre>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -367,24 +367,6 @@ inherited by all classes except defines.
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<span class='name'>ne_ssl_use_adh</span>
|
|
||||||
|
|
||||||
|
|
||||||
<span class='type'>(<tt>String</tt>)</span>
|
|
||||||
|
|
||||||
|
|
||||||
<em class="default">(defaults to: <tt>'1'</tt>)</em>
|
|
||||||
|
|
||||||
|
|
||||||
—
|
|
||||||
<div class='inline'>
|
|
||||||
<p>This is for backward compatibility and is DEPRECATED. Set to 1 to enable ADH or 2 to require ADH. 1 is currently the default but will be changed in a later version.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
|
|
||||||
<span class='name'>ne_ssl_cipher_list</span>
|
<span class='name'>ne_ssl_cipher_list</span>
|
||||||
@@ -403,24 +385,6 @@ inherited by all classes except defines.
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<span class='name'>ne_ssl_cacert_file</span>
|
|
||||||
|
|
||||||
|
|
||||||
<span class='type'>(<tt>String</tt>)</span>
|
|
||||||
|
|
||||||
|
|
||||||
<em class="default">(defaults to: <tt>'/etc/pki/tls/certs/ca-chain.crt.pem'</tt>)</em>
|
|
||||||
|
|
||||||
|
|
||||||
—
|
|
||||||
<div class='inline'>
|
|
||||||
<p>path and name of the ssl certificate authority (ca) file / chain. must be full path.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
|
|
||||||
<span class='name'>ne_ssl_client_certs</span>
|
<span class='name'>ne_ssl_client_certs</span>
|
||||||
@@ -429,7 +393,7 @@ inherited by all classes except defines.
|
|||||||
<span class='type'>(<tt>String</tt>)</span>
|
<span class='type'>(<tt>String</tt>)</span>
|
||||||
|
|
||||||
|
|
||||||
<em class="default">(defaults to: <tt>'2'</tt>)</em>
|
<em class="default">(defaults to: <tt>'0'</tt>)</em>
|
||||||
|
|
||||||
|
|
||||||
—
|
—
|
||||||
@@ -817,6 +781,11 @@ inherited by all classes except defines.
|
|||||||
<pre class="lines">
|
<pre class="lines">
|
||||||
|
|
||||||
|
|
||||||
|
84
|
||||||
|
85
|
||||||
|
86
|
||||||
|
87
|
||||||
|
88
|
||||||
89
|
89
|
||||||
90
|
90
|
||||||
91
|
91
|
||||||
@@ -905,16 +874,10 @@ inherited by all classes except defines.
|
|||||||
174
|
174
|
||||||
175
|
175
|
||||||
176
|
176
|
||||||
177
|
177</pre>
|
||||||
178
|
|
||||||
179
|
|
||||||
180
|
|
||||||
181
|
|
||||||
182
|
|
||||||
183</pre>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 89</span>
|
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 84</span>
|
||||||
|
|
||||||
class confdroid_nrpe::params (
|
class confdroid_nrpe::params (
|
||||||
|
|
||||||
@@ -947,10 +910,8 @@ class confdroid_nrpe::params (
|
|||||||
String $ne_allow_weak_rnd_seed = '1',
|
String $ne_allow_weak_rnd_seed = '1',
|
||||||
Boolean $ne_enable_ssl = false,
|
Boolean $ne_enable_ssl = false,
|
||||||
String $ne_ssl_version = 'TLSv2+',
|
String $ne_ssl_version = 'TLSv2+',
|
||||||
String $ne_ssl_use_adh = '1',
|
|
||||||
String $ne_ssl_cipher_list = 'ALL:!aNULL:!eNULL:!SSLv2:!LOW:!EXP:!RC4:!MD5:@STRENGTH',
|
String $ne_ssl_cipher_list = 'ALL:!aNULL:!eNULL:!SSLv2:!LOW:!EXP:!RC4:!MD5:@STRENGTH',
|
||||||
String $ne_ssl_cacert_file = '/etc/pki/tls/certs/ca-chain.crt.pem',
|
String $ne_ssl_client_certs = '0',
|
||||||
String $ne_ssl_client_certs = '2',
|
|
||||||
String $ne_ssl_logging = '0x00',
|
String $ne_ssl_logging = '0x00',
|
||||||
Array $ne_nasty_metachars = ["|`&><'\\[]{};\r\n"],
|
Array $ne_nasty_metachars = ["|`&><'\\[]{};\r\n"],
|
||||||
String $ne_include_file = '',
|
String $ne_include_file = '',
|
||||||
@@ -983,6 +944,7 @@ class confdroid_nrpe::params (
|
|||||||
# directories
|
# directories
|
||||||
$ne_main_conf_d_dir = '/etc/nrpe.d'
|
$ne_main_conf_d_dir = '/etc/nrpe.d'
|
||||||
$ne_run_dir = '/var/run/nrpe'
|
$ne_run_dir = '/var/run/nrpe'
|
||||||
|
$ne_servercert_dir = '/etc/pki/tls/servercerts'
|
||||||
|
|
||||||
# files
|
# files
|
||||||
$ne_main_conf_file = '/etc/nagios/nrpe.cfg'
|
$ne_main_conf_file = '/etc/nagios/nrpe.cfg'
|
||||||
@@ -1001,11 +963,11 @@ class confdroid_nrpe::params (
|
|||||||
$ne_checkmodule_nrpe_erb = 'confdroid_nrpe/checkmodule_nrpe.erb'
|
$ne_checkmodule_nrpe_erb = 'confdroid_nrpe/checkmodule_nrpe.erb'
|
||||||
$ne_nrpe_pp_file = "${ne_main_conf_d_dir}/nrpe.pp"
|
$ne_nrpe_pp_file = "${ne_main_conf_d_dir}/nrpe.pp"
|
||||||
$ne_semodule_erb = 'confdroid_nrpe/semodule_nrpe.erb'
|
$ne_semodule_erb = 'confdroid_nrpe/semodule_nrpe.erb'
|
||||||
$ne_ssl_cert_file = '/etc/pki/tls/certs/nagios.crt.pem'
|
$ne_ssl_cert_file = "${ne_servercert_dir}/nagios-crt.pem"
|
||||||
$ne_ssl_cert_erb = 'confdroid_nrpe/ssl_cert.erb'
|
$ne_ssl_cert_erb = 'confdroid_nrpe/ssl_cert.erb'
|
||||||
$ne_ssl_privatekey_file = '/etc/pki/tls/private/nagios.key.pem'
|
$ne_ssl_privatekey_file = "${ne_servercert_dir}/nagios-key.pem"
|
||||||
$ne_ssl_privatekey_erb = 'confdroid_nrpe/ssl_privatekey.erb'
|
$ne_ssl_privatekey_erb = 'confdroid_nrpe/ssl_privatekey.erb'
|
||||||
$ne_ssl_ca_cert_file = '/etc/pki/tls/certs/ca-chain.crt.pem'
|
$ne_ssl_ca_cert_file = "${ne_servercert_dir}/ca-cert.pem"
|
||||||
$ne_ssl_ca_cert_erb = 'confdroid_nrpe/ssl_ca_cert.erb'
|
$ne_ssl_ca_cert_erb = 'confdroid_nrpe/ssl_ca_cert.erb'
|
||||||
|
|
||||||
# includes must be last
|
# includes must be last
|
||||||
|
|||||||
@@ -33,4 +33,18 @@ class confdroid_nrpe::main::dirs (
|
|||||||
seltype => var_run_t,
|
seltype => var_run_t,
|
||||||
seluser => system_u,
|
seluser => system_u,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $ne_enable_ssl {
|
||||||
|
file { $ne_servercert_dir:
|
||||||
|
ensure => directory,
|
||||||
|
path => $ne_servercert_dir,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0755',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => cert_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,9 +32,6 @@
|
|||||||
# NRPE daemon will wait for a connection to be established before exiting.
|
# NRPE daemon will wait for a connection to be established before exiting.
|
||||||
# @param [String] ne_ssl_version These directives allow you to specify how to
|
# @param [String] ne_ssl_version These directives allow you to specify how to
|
||||||
# use SSL/TLS.
|
# use SSL/TLS.
|
||||||
# @param [String] ne_ssl_use_adh This is for backward compatibility and is
|
|
||||||
# DEPRECATED. Set to 1 to enable ADH or 2 to require ADH. 1 is currently the
|
|
||||||
# default but will be changed in a later version.
|
|
||||||
# @param [String] ne_ssl_cipher_list ciphers can be used. For backward
|
# @param [String] ne_ssl_cipher_list ciphers can be used. For backward
|
||||||
# compatibility, this defaults to 'ssl_cipher_list=ALL:!MD5:@STRENGTH' in
|
# compatibility, this defaults to 'ssl_cipher_list=ALL:!MD5:@STRENGTH' in
|
||||||
# this version but will be changed in a later version of NRPE.
|
# this version but will be changed in a later version of NRPE.
|
||||||
@@ -115,9 +112,8 @@ class confdroid_nrpe::params (
|
|||||||
String $ne_allow_weak_rnd_seed = '1',
|
String $ne_allow_weak_rnd_seed = '1',
|
||||||
Boolean $ne_enable_ssl = false,
|
Boolean $ne_enable_ssl = false,
|
||||||
String $ne_ssl_version = 'TLSv2+',
|
String $ne_ssl_version = 'TLSv2+',
|
||||||
String $ne_ssl_use_adh = '1',
|
|
||||||
String $ne_ssl_cipher_list = 'ALL:!aNULL:!eNULL:!SSLv2:!LOW:!EXP:!RC4:!MD5:@STRENGTH',
|
String $ne_ssl_cipher_list = 'ALL:!aNULL:!eNULL:!SSLv2:!LOW:!EXP:!RC4:!MD5:@STRENGTH',
|
||||||
String $ne_ssl_client_certs = '2',
|
String $ne_ssl_client_certs = '0',
|
||||||
String $ne_ssl_logging = '0x00',
|
String $ne_ssl_logging = '0x00',
|
||||||
Array $ne_nasty_metachars = ["|`&><'\\[]{};\r\n"],
|
Array $ne_nasty_metachars = ["|`&><'\\[]{};\r\n"],
|
||||||
String $ne_include_file = '',
|
String $ne_include_file = '',
|
||||||
@@ -150,6 +146,7 @@ class confdroid_nrpe::params (
|
|||||||
# directories
|
# directories
|
||||||
$ne_main_conf_d_dir = '/etc/nrpe.d'
|
$ne_main_conf_d_dir = '/etc/nrpe.d'
|
||||||
$ne_run_dir = '/var/run/nrpe'
|
$ne_run_dir = '/var/run/nrpe'
|
||||||
|
$ne_servercert_dir = '/etc/pki/tls/servercerts'
|
||||||
|
|
||||||
# files
|
# files
|
||||||
$ne_main_conf_file = '/etc/nagios/nrpe.cfg'
|
$ne_main_conf_file = '/etc/nagios/nrpe.cfg'
|
||||||
@@ -168,11 +165,11 @@ class confdroid_nrpe::params (
|
|||||||
$ne_checkmodule_nrpe_erb = 'confdroid_nrpe/checkmodule_nrpe.erb'
|
$ne_checkmodule_nrpe_erb = 'confdroid_nrpe/checkmodule_nrpe.erb'
|
||||||
$ne_nrpe_pp_file = "${ne_main_conf_d_dir}/nrpe.pp"
|
$ne_nrpe_pp_file = "${ne_main_conf_d_dir}/nrpe.pp"
|
||||||
$ne_semodule_erb = 'confdroid_nrpe/semodule_nrpe.erb'
|
$ne_semodule_erb = 'confdroid_nrpe/semodule_nrpe.erb'
|
||||||
$ne_ssl_cert_file = '/etc/pki/tls/certs/nagios.crt.pem'
|
$ne_ssl_cert_file = "${ne_servercert_dir}/nagios-crt.pem"
|
||||||
$ne_ssl_cert_erb = 'confdroid_nrpe/ssl_cert.erb'
|
$ne_ssl_cert_erb = 'confdroid_nrpe/ssl_cert.erb'
|
||||||
$ne_ssl_privatekey_file = '/etc/pki/tls/private/nagios.key.pem'
|
$ne_ssl_privatekey_file = "${ne_servercert_dir}/nagios-key.pem"
|
||||||
$ne_ssl_privatekey_erb = 'confdroid_nrpe/ssl_privatekey.erb'
|
$ne_ssl_privatekey_erb = 'confdroid_nrpe/ssl_privatekey.erb'
|
||||||
$ne_ssl_ca_cert_file = '/etc/pki/tls/certs/ca-chain.crt.pem'
|
$ne_ssl_ca_cert_file = "${ne_servercert_dir}/ca-cert.pem"
|
||||||
$ne_ssl_ca_cert_erb = 'confdroid_nrpe/ssl_ca_cert.erb'
|
$ne_ssl_ca_cert_erb = 'confdroid_nrpe/ssl_ca_cert.erb'
|
||||||
|
|
||||||
# includes must be last
|
# includes must be last
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ allow_weak_random_seed=<%= @ne_allow_weak_rnd_seed %>
|
|||||||
|
|
||||||
<% if @ne_enable_ssl == true -%>
|
<% if @ne_enable_ssl == true -%>
|
||||||
ssl_version=<%= @ne_ssl_version %>
|
ssl_version=<%= @ne_ssl_version %>
|
||||||
ssl_use_adh=<%= @ne_ssl_use_adh %>
|
|
||||||
ssl_cipher_list=<%= @ne_ssl_cipher_list %>
|
ssl_cipher_list=<%= @ne_ssl_cipher_list %>
|
||||||
ssl_cacert_file=<%= @ne_ssl_ca_cert_file %>
|
ssl_cacert_file=<%= @ne_ssl_ca_cert_file %>
|
||||||
ssl_cert_file=<%= @ne_ssl_cert_file %>
|
ssl_cert_file=<%= @ne_ssl_cert_file %>
|
||||||
|
|||||||
Reference in New Issue
Block a user