diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index c880235..0000000 --- a/Jenkinsfile +++ /dev/null @@ -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_nagios \ - -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_nagios.git - git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ - push master --mirror - ''' - } - } - } - } - } -} - diff --git a/doc/file.README.html b/doc/file.README.html index fc11244..526b481 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -143,8 +143,6 @@

if ng_include_nrpeis set to true, the confdroid_nrpe module is automatically applied on clients (confdroid_nrpe must be in the catalogue then)

  • if ng_enable_fail2banis set to true, a fail2ban jail and filter will be added for the Nagios service (requires confdroid_fail2ban).

    -
  • -

    manage remoteIP logging if running behind a Loadbalancer like HAproxy: if ng_use_lb is set to true, a configuration file etc/httpd/conf.d/loadbalancer-remoteip.confis created and configures apache/httpd to use the remote header. This allows proper fail2ban protection even behind the Loadbalancer. Make sure to set ng_trusted_proxyto the proper IP or range for the loadbalancer!

  • Repo Documentation

    diff --git a/doc/index.html b/doc/index.html index 020ca9b..6618dd5 100644 --- a/doc/index.html +++ b/doc/index.html @@ -143,8 +143,6 @@

    if ng_include_nrpeis set to true, the confdroid_nrpe module is automatically applied on clients (confdroid_nrpe must be in the catalogue then)

  • if ng_enable_fail2banis set to true, a fail2ban jail and filter will be added for the Nagios service (requires confdroid_fail2ban).

    -
  • -

    manage remoteIP logging if running behind a Loadbalancer like HAproxy: if ng_use_lb is set to true, a configuration file etc/httpd/conf.d/loadbalancer-remoteip.confis created and configures apache/httpd to use the remote header. This allows proper fail2ban protection even behind the Loadbalancer. Make sure to set ng_trusted_proxyto the proper IP or range for the loadbalancer!

  • Repo Documentation

    diff --git a/doc/puppet_classes/confdroid_nagios_3A_3Aparams.html b/doc/puppet_classes/confdroid_nagios_3A_3Aparams.html index 3bc11c2..7ebcaee 100644 --- a/doc/puppet_classes/confdroid_nagios_3A_3Aparams.html +++ b/doc/puppet_classes/confdroid_nagios_3A_3Aparams.html @@ -4075,42 +4075,6 @@ inherited by all classes except defines. -
  • - - ng_use_lb - - - (Boolean) - - - (defaults to: false) - - - — -
    -

    Whether to use load balancing for the Nagios server. Default is false.

    -
    - -
  • - -
  • - - ng_trusted_proxy - - - (String) - - - (defaults to: '10.0.0.10') - - - — -
    -

    The IP address of the trusted proxy to access the Nagios server. Default is ‘10.0.0.10’.

    -
    - -
  • -
  • ng_use_ssl_auth @@ -4135,6 +4099,10 @@ inherited by all classes except defines.
     
     
    +445
    +446
    +447
    +448
     449
     450
     451
    @@ -4475,17 +4443,10 @@ inherited by all classes except defines.
     786
     787
     788
    -789
    -790
    -791
    -792
    -793
    -794
    -795
    -796
    +789 -
    # File 'manifests/params.pp', line 449
    +        
    # File 'manifests/params.pp', line 445
     
     class confdroid_nagios::params (
     
    @@ -4503,8 +4464,6 @@ class confdroid_nagios::params (
       String $ng_user                       = 'nagios',
       Boolean $ng_enable_target             = true,
       Boolean $ng_purge_target              = true,
    -  Boolean $ng_use_lb                    = false,
    -  String $ng_trusted_proxy              = '10.0.0.10',
     
     # contact groups
       String $ng_contactgroup_name          = 'admins',
    @@ -4775,7 +4734,6 @@ class confdroid_nagios::params (
       $ng_nagios_cfg_erb          = 'confdroid_nagios/nagios/nagios_cfg.erb'
       $ng_cgi_cfg_file            = "${ng_main_dir}/cgi.cfg"
       $ng_cgi_cfg_erb             = 'confdroid_nagios/nagios/cgi_cfg.erb'
    -  $ng_remoteip_file           = '/etc/httpd/conf.d/loadbalancer-remoteip.conf'
     
     # nagios
       $ng_target_templates        = "${ng_conf_d_dir}/nagios_templates.cfg"
    diff --git a/doc/puppet_classes/confdroid_nagios_3A_3Aserver_3A_3Afiles.html b/doc/puppet_classes/confdroid_nagios_3A_3Aserver_3A_3Afiles.html
    index f0c0a80..a1d7cf2 100644
    --- a/doc/puppet_classes/confdroid_nagios_3A_3Aserver_3A_3Afiles.html
    +++ b/doc/puppet_classes/confdroid_nagios_3A_3Aserver_3A_3Afiles.html
    @@ -143,22 +143,7 @@
     45
     46
     47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -62
    -63
    +48
    # File 'manifests/server/files.pp', line 6
    @@ -204,21 +189,6 @@ class confdroid_nagios::server::files (
           seltype  => nagios_var_run_t,
           seluser  => system_u,
         }
    -
    -    if $ng_use_lb == true {
    -      file { $ng_remoteip_file:
    -        ensure   => file,
    -        owner    => 'root',
    -        group    => 'root',
    -        mode     => '0644',
    -        selrange => s0,
    -        selrole  => object_r,
    -        seltype  => httpd_conf_t,
    -        seluser  => system_u,
    -        content  => template('confdroid_nagios/loadbalancer/remoteip.conf.erb'),
    -        notify   => Service['httpd'],
    -      }
    -    }
       }
     }