From 2f48d845028aa463f6a61b090efe8db58b656f4a Mon Sep 17 00:00:00 2001
From: Arne Teuke
Date: Thu, 5 Aug 2021 17:34:50 +0200
Subject: [PATCH] EN-0001 - add new stages
---
.mdl_style.rb | 4 +
.mdlrc | 2 +
.spelling | 18 +++++
CHANGELOG.md | 169 ----------------------------------------
Gemfile | 3 +-
Jenkinsfile | 28 ++++++-
README.md | 77 ++++++++----------
REPOSTRUCTURE.md | 44 -----------
templates/scan_conf.erb | 6 +-
9 files changed, 84 insertions(+), 267 deletions(-)
create mode 100644 .mdl_style.rb
create mode 100644 .mdlrc
create mode 100644 .spelling
delete mode 100644 CHANGELOG.md
delete mode 100644 REPOSTRUCTURE.md
diff --git a/.mdl_style.rb b/.mdl_style.rb
new file mode 100644
index 0000000..267f8d6
--- /dev/null
+++ b/.mdl_style.rb
@@ -0,0 +1,4 @@
+all
+# exlude line lenght
+# exclude_rule 'MD013'
+rule 'MD013', :line_length => 1000
diff --git a/.mdlrc b/.mdlrc
new file mode 100644
index 0000000..e5c563a
--- /dev/null
+++ b/.mdlrc
@@ -0,0 +1,2 @@
+style '.mdl_style.rb'
+
diff --git a/.spelling b/.spelling
new file mode 100644
index 0000000..94db1e8
--- /dev/null
+++ b/.spelling
@@ -0,0 +1,18 @@
+# markdown-spellcheck spelling configuration file
+# Format - lines begining # are comments
+# global dictionary is at the start, file overrides afterwards
+# one word per line, to define a file override use ' - filename'
+# where filename is relative to this configuration file
+Readme.md
+sudo
+selinux
+site.pp
+nodes.pp
+cd_sudo
+::
+params
+Foreman
+cd_resources
+CentOS
+Puppet
+ConfDroid
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index dfd6b9e..0000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,169 +0,0 @@
- Git Changelog changelog
-
-
-Changelog of Git Changelog.
-
-
- Unreleased
- No issue
-
-96cb29bd1845c61 Jenkins ConfDroid 2019-12-26 16:26:48
-
-
recommit for updates in build 25
-
-
-795543319c34b3b Arne Teuke 2019-12-26 16:26:06
-
-
changes packages
-
-
-3f2934b4a3e16c4 Jenkins ConfDroid 2019-12-26 16:03:26
-
-
recommit for updates in build 24
-
-
-1e6d36787bd5827 Arne Teuke 2019-12-26 16:02:49
-
-
changes packages
-
-
-a69c0e096e10f44 Jenkins ConfDroid 2019-12-26 16:01:59
-
-
recommit for updates in build 23
-
-
-321186fc7f76c7a Arne Teuke 2019-12-26 16:01:18
-
-
changes packages
-
-
-87b72468db8186a Jenkins ConfDroid 2019-12-24 22:58:56
-
-
recommit for updates in build 22
-
-
-830805df577ff60 Arne Teuke 2019-12-24 22:58:13
-
-
adds controls for service, files and dirs, plus templates
-
-
-9f2852d61edbc5b Jenkins ConfDroid 2019-12-24 22:24:14
-
-
recommit for updates in build 21
-
-
-08d621b25c90d4d Arne Teuke 2019-12-24 22:23:25
-
-
adds controls for service, files and dirs, plus templates
-
-
-0d8da38d9c95ac7 Jenkins ConfDroid 2019-12-24 21:37:12
-
-
recommit for updates in build 20
-
-
-c18a28c767382a2 Arne Teuke 2019-12-24 21:36:34
-
-
removes link to yumrepo
-
-
-18ea2b3878bb807 Jenkins ConfDroid 2019-12-24 21:17:31
-
-
recommit for updates in build 19
-
-
-f57ba6bdd6fa0f0 Arne Teuke 2019-12-24 21:16:56
-
-
changes jenkinsfile
-
-
-02ba2a45c27f44d Jenkins ConfDroid 2019-12-24 21:14:23
-
-
recommit for updates in build 18
-
-
-df9e0543567ec50 Arne Teuke 2019-12-24 21:13:49
-
-
uses local jenkins
-
-
-637fcb8e3542fae Jenkins ConfDroid 2019-12-24 21:11:15
-
-
recommit for updates in build 17
-
-
-cb490dde982aa67 Arne Teuke 2019-12-24 21:10:41
-
-
uses local jenkins
-
-
-27917c238c71e25 Jenkins ConfDroid 2019-12-24 21:08:56
-
-
recommit for updates in build 16
-
-
-c9cb8ab6c66eb34 Arne Teuke 2019-12-24 21:08:19
-
-
uses local jenkins
-
-
-1030d02d6008fe1 Arne Teuke 2019-12-24 21:01:44
-
-
uses local jenkins
-
-
-27d92691fa6671a Arne Teuke 2019-12-24 20:56:22
-
-
updates params
-
-
-
- 0.0.0.1
- No issue
-
-ed8495b996a33c4 Arne Teuke 2019-11-14 20:08:28
-
-
edited README
-
-
-27fe01f972f377d Arne Teuke 2019-11-14 19:37:19
-
-
updates Readme
-
-
-557fbb02f14d54a Arne Teuke 2019-10-28 16:55:37
-
-
testing slaves
-
-
-c1b525e5f2ca2d8 Arne Teuke 2019-10-28 16:54:08
-
-
testing slaves
-
-
-e7b065781337daa Arne Teuke 2019-10-28 16:52:11
-
-
testing slaves
-
-
-f50af6022925a12 Arne Teuke 2019-10-28 16:50:21
-
-
testing slaves
-
-
-44092c835ab2d2a Arne Teuke 2019-10-28 16:49:11
-
-
testing slaves
-
-
-e7a1636635266e0 Arne Teuke 2019-10-28 16:47:06
-
-
testing slaves
-
-
-03e4718163c8064 Arne Teuke 2019-10-28 16:40:12
-
-
testing slaves
-
-
-
diff --git a/Gemfile b/Gemfile
index e9584ba..49f82d7 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,7 +3,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['<= 5.5.6']
gem 'metadata-json-lint', '~> 2.4'
gem 'puppet', puppetversion
-gem 'puppetlabs_spec_helper', '>= 1.0.0'
+gem 'puppetlabs_spec_helper', '~> 3.0'
gem 'puppet-lint'
gem 'facter'
gem 'rspec-puppet'
@@ -15,6 +15,7 @@ gem 'rgen'
gem 'public_suffix', '<= 2.0.5'
gem 'parallel', '<= 1.13.0'
gem 'puppet-syntax', '~> 2.6', '>= 2.6.1'
+gem 'pathspec', '~> 0.2.1'
# rspec must be v2 for ruby 1.8.7
if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
diff --git a/Jenkinsfile b/Jenkinsfile
index c57b684..1cc4a48 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -70,13 +70,35 @@ pipeline {
}
}
- stage('update repo structure') {
+ stage('markdown-lint') {
steps {
- sh '''rm -Rf REPOSTRUCTURE.md
- echo "$(tree --dirsfirst --charset=ascii .)" > REPOSTRUCTURE.md'''
+ sh '''
+ source /opt/rh/rh-ruby27/enable
+ mdl README.md
+ '''
}
}
+ stage('spell check') {
+ steps {
+ sh '''
+ mdspell -r -n -a "**/*.md"
+ '''
+ }
+ }
+
+ stage('SonarScan') {
+ steps {
+ sh '''
+ /opt/sonar-scanner/bin/sonar-scanner \
+ -Dsonar.projectKey=cd_clamav \
+ -Dsonar.sources=. \
+ -Dsonar.host.url=http://sonarqube.confdroid.com \
+ -Dsonar.login=f4d68d1f43370b34439eee7fbf5e2b6182cf449c
+ '''
+ }
+ }
+
stage('create Puppet documention') {
steps {
sh '/opt/puppetlabs/bin/puppet strings'
diff --git a/README.md b/README.md
index b33ddc3..23d6fe9 100644
--- a/README.md
+++ b/README.md
@@ -1,95 +1,80 @@
+# Readme
+
[](https://pipelines.confdroid.com/job/cd_clamav/)|
-### Synopsis
+[[_TOC_]]
+
+## Synopsis
+
`Clamav` is a powerful antivirus scanner with several components.
`cd_clamav` is a puppet module to manage clamav installations and configurations.
-### WARNING
+## WARNING
+
`**__!!! Attention: Never use this puppet module on systems which have been previously configured manually. It is impossible to predict how and what would have been configured, hence previuos configurations outside the scope of this module may be overwritten! Automated configurations require a test environment to verify that the module suits the purpose intended by the user, as well as tune the parameters, before deploying into live production!!! __**`
-### Table of Contents
-* [Features](#features)
-* [Repo Structure](https://sourcecode.confdroid.com/12WW1160/cd_clamav/blob/master/REPOSTRUCTURE.md)
-* [ Repo Documentation](#repo-documentation)
-* [Dependencies](#dependencies)
-* [Deployment](#deployment)
- * [native Puppet deployment](#native-puppet-deployment)
- * [through Foreman](#through-foreman)
-* [Parameters](#parameters)
- * [Mandatory Parameters](#mandatory-parameters)
- * [Optional Parameters](#optional-parameters)
-* [SELINUX](#selinux)
-* [Known Problems](#known-problems)
-* [Support](#support)
-* [Tests](#tests)
-* [Contact Us](https://confdroid.com/contact/)
-* [Disclaimer](#disclaimer)
+## Features
-### Features
-
-### Repo Structure
-Repostructure has moved to REPOSTRUCTURE.md in repo.
-
-### Repo Documentation
+## Repo Documentation
See the full Puppet documentation in docs/index.html
-### Dependencies
+## Dependencies
All dependencies must be included in the catalogue.
* [cd_resources](https://sourcecode.confdroid.com/12WW1160/cd_resources) to manage yum base repos
### Deployment
-##### native Puppet deployment
+* native Puppet deployment
via site.pp or nodes.pp
-```
+```bash
node 'example.example.net' {
include cd_clamav
}
```
-#### through Foreman:
+
+* through Foreman:
+
In order to apply parameters through Foreman, **__cd_clamav::params__** must be added to the host or hostgroup in question.
See [more details about class deployment on Confdroid.com](https://confdroid.com/2017/05/deploying-our-puppet-modules/).
+## Parameters
-### Parameters
-The following parameters are editable via params.pp or through ENC (**__recommended__**). Values changed will take immediate effect at next puppet run. Services will be restarted where neccessary.
+The parameters are documented via puppet strings and [listed here](/docs/index.html). Simply open in web browser.
-The [full list of Parameters](https://confdroid.com/2017/08/cd_clamav-parameters/) is available [here](https://confdroid.com/2019/09/cd_clamav-parameters/) and in the docs folder in the software repo.
+## SELINUX
-#### Mandatory Parameters
-
-There are currently no mandatory parameters, i.e. the module will function right out of box as is.
-
-#### Optional Parameters
-
-
-### SELINUX
All files and directories are configured with correct selinux context. If selinux is disabled, these contexts are ignored.
-### Known Problems
+## Support
-### Support
* OS: CentOS 7
* Puppet 5.x
-### Tests
+## Tests
+
* Puppet Lint
* excluded tests:
- * `--no-class_inherits_from_params_class-check`:relavant only to non-supported outdated puppet versions
+ * `--no-class_inherits_from_params_class-check`:relevant only to non-supported outdated puppet versions
* `--no-variable_scope-check`: not applicable as we are inheriting parameters from params class. the lint check does not distinguish between facts and inherited parameters.
* `--no-80chars-check`: it is not always possible to stay within 80 characters, although typically only occurring on the parameter vault `params.pp`.
* `--no-arrow_alignment-check`: this check leads to actually not having am easily readable arrow alignment, as this checks `per block`, not per class.
* Puppet Parser
* ERB Template Parser
* Test for unwanted UTF8 files in the Puppet code as this causes problems with PuppetDB (see tests/UTF_Files)
-### Contact Us
+* Markdown-lint
+* Spellcheck
+* Sonar Quality Gate
+
+## Contact Us
+
[contact Us](https://confdroid.com/contact/)
-### Disclaimer
+## Disclaimer
+
ConfDroid as entity is entirely independent from Puppet. We provide custom configuration modules, written for specific purposes and specific environments.
The modules are tested and supported only as documented, and require testing in designated environments (i.e. lab or development environments) for parameter tuning etc. before deploying into production environments.
diff --git a/REPOSTRUCTURE.md b/REPOSTRUCTURE.md
deleted file mode 100644
index 8cd8ef6..0000000
--- a/REPOSTRUCTURE.md
+++ /dev/null
@@ -1,44 +0,0 @@
-.
-|-- doc
-| |-- css
-| | |-- common.css
-| | |-- full_list.css
-| | `-- style.css
-| |-- js
-| | |-- app.js
-| | |-- full_list.js
-| | `-- jquery.js
-| |-- puppet_classes
-| | |-- cd_clamav_3A_3Amain_3A_3Aconfig.html
-| | |-- cd_clamav_3A_3Amain_3A_3Adirs.html
-| | |-- cd_clamav_3A_3Amain_3A_3Afiles.html
-| | |-- cd_clamav_3A_3Amain_3A_3Ainstall.html
-| | |-- cd_clamav_3A_3Amain_3A_3Aservice.html
-| | |-- cd_clamav_3A_3Aparams.html
-| | `-- cd_clamav.html
-| |-- file.README.html
-| |-- frames.html
-| |-- _index.html
-| |-- index.html
-| |-- puppet_class_list.html
-| `-- top-level-namespace.html
-|-- manifests
-| |-- main
-| | |-- config.pp
-| | |-- dirs.pp
-| | |-- files.pp
-| | |-- install.pp
-| | `-- service.pp
-| |-- init.pp
-| `-- params.pp
-|-- templates
-| |-- freshclam_conf.erb
-| `-- scan_conf.erb
-|-- CHANGELOG.md
-|-- Gemfile
-|-- Gemfile.lock
-|-- Jenkinsfile
-|-- LICENSE
-`-- README.md
-
-7 directories, 34 files
diff --git a/templates/scan_conf.erb b/templates/scan_conf.erb
index f400746..0d1bc68 100755
--- a/templates/scan_conf.erb
+++ b/templates/scan_conf.erb
@@ -12,14 +12,12 @@ LogSyslog <%= @cv_logsyslog %>
LogFacility <%= @cv_logfacility %>
LogVerbose <%= @cv_logverbose %>
LogRotate <%= @cv_logrotate %>
+PreludeEnable <%= @cv_preludeenable %>
-# Enable Prelude output.
-# Default: no
-PreludeEnable yes
#
# Set the name of the analyzer used by prelude-admin.
# Default: ClamAV
-#PreludeAnalyzerName ClamAV
+PreludeAnalyzerName ClamAV
# Log additional information about the infected file, such as its
# size and hash, together with the virus name.