Compare commits

..

17 Commits

Author SHA1 Message Date
Jenkins
dfc90f5bf6 Merge branch 'jenkins-build-1' into 'master'
Auto-merge for build 1

See merge request puppet/confdroid_ssh!1
2026-04-05 15:17:45 +02:00
256cf6ad08 OP#561 initial commit after fork 2026-04-05 14:39:09 +02:00
Jenkins
efdc857056 Merge branch 'jenkins-build-3' into 'master'
Auto-merge for build 3

See merge request puppet/ssh_cd!1
2025-07-03 21:37:28 +00:00
Arne Teuke
da57a39a62 add new MR approach 2025-06-06 18:19:40 +02:00
Arne Teuke
60227434d5 fix build info and Jenkins pipeline 2025-05-22 19:13:26 +02:00
Arne Teuke
84977adbc5 adjust everything for compliance with puppet-lint 2025-05-16 11:58:00 +02:00
Jenkins ConfDroid
ac7699e75d Merge branch 'master' of gitlab.confdroid.com:puppet/ssh_cd into HEAD 2025-04-24 20:13:15 +02:00
Arne Teuke
f8f31dfc55 fix init 2025-04-24 20:12:59 +02:00
Jenkins ConfDroid
dd089da959 Merge branch 'master' of gitlab.confdroid.com:puppet/ssh_cd into HEAD 2025-04-23 14:28:38 +02:00
Arne Teuke
4ba4fdcd59 edit link for build status 2025-04-23 14:28:23 +02:00
Jenkins ConfDroid
e02ae9235c Merge branch 'master' of gitlab.confdroid.com:puppet/ssh_cd into HEAD 2025-04-23 14:12:38 +02:00
Jenkins ConfDroid
63682ed6b1 Merge branch 'master' of gitlab.confdroid.com:puppet/ssh_cd into HEAD 2025-04-23 14:08:10 +02:00
sunrider
d22955d0d9 Update 2 files
- /.scannerwork/.sonar_lock
- /.scannerwork/report-task.txt
2025-04-23 11:34:16 +00:00
Jenkins ConfDroid
54ed3f5567 recommit for updates in build 11 2025-04-23 13:28:20 +02:00
Jenkins ConfDroid
f9e9796a97 recommit for updates in build 10 2025-04-23 13:20:03 +02:00
Jenkins ConfDroid
b764d9903e recommit for updates in build 9 2025-04-23 13:19:20 +02:00
Jenkins ConfDroid
b526c90e50 recommit for updates in build 8 2025-04-22 15:59:49 +02:00
11 changed files with 84 additions and 161 deletions

3
.gitignore vendored
View File

@@ -34,3 +34,6 @@
.plan_cache.json .plan_cache.json
.rerun.json .rerun.json
bolt-debug.log bolt-debug.log
.vscode
.puppet-lint.rc
.rspec

96
Jenkinsfile vendored
View File

@@ -1,96 +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
git pull origin master
git checkout -b jenkins '''
}
}
}
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 '''find . -iname *.pp -exec /usr/local/rvm/gems/ruby-2.5.0/wrappers/puppet-lint \\
--no-class_inherits_from_params_class-check \\
--no-variable_scope-check \\
--no-80chars-check \\
--no-arrow_alignment-check \\
--no-autoloader_layout-check \\
--no-140chars-check \\
--log-format "%{path}:%{line}:%{check}:%{KIND}:%{message}" {} \\;
'''
recordIssues aggregatingResults: true, tool: puppetLint()
}
}
stage('SonarScan') {
steps {
sh '''
/opt/sonar-scanner/bin/sonar-scanner \
-Dsonar.projectKey=ssh_cd \
-Dsonar.sources=. \
-Dsonar.host.url=https://sonarqube.confdroid.com \
-Dsonar.token=sqa_aca21cc41336d0f31987ed196ccfb9be55ded774
'''
}
}
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
echo `git add -A && git commit -am "recommit for updates in build $BUILD_NUMBER"`
git push origin HEAD:master'''
}
}
}
}
}

View File

@@ -1,12 +1,21 @@
# Readme # Readme
[![Build Status](https://pipelines.confdroid.com/buildStatus/icon?job=ssh_cd) [![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=confdroid_ssh&style=plastic)](https://jenkins.confdroid.com/job/confdroid_ssh/)
[[_TOC_]] - [Readme](#readme)
- [Synopsis](#synopsis)
- [WARNING](#warning)
- [Features](#features)
- [Support](#support)
- [Parameter Inheritance](#parameter-inheritance)
- [Module Deployment](#module-deployment)
- [Tests](#tests)
- [Contact Us](#contact-us)
- [Disclaimer](#disclaimer)
## Synopsis ## Synopsis
`ssh_cd`manages the aspects of the sshd daemon. `confdroid_ssh`manages the aspects of the sshd daemon.
## WARNING ## WARNING
@@ -14,12 +23,10 @@
## Features ## Features
See [CHANGELOG.md](CHANGELOG.md)
## Support ## Support
* Rocky 9 - Rocky 9
* Puppet 8 - Puppet 8
## Parameter Inheritance ## Parameter Inheritance
@@ -31,22 +38,17 @@ ALmost every puppet setup is done in very custom ways, and hence the way the mod
## Tests ## Tests
* Puppet Lint - Puppet Lint
* excluded tests: - excluded tests:
* `--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-variable_scope-check`: not applicable as we are inheriting parameters from params class. the lint check does not distinguish between facts and inherited parameters. - Puppet Parser
* `--no-80chars-check`: it is not always possible to stay within 80 characters, although typically only occurring on the parameter vault `params.pp`. - ERB Template Parser
* `--no-arrow_alignment-check`: this check leads to actually not having am easily readable arrow alignment, as this checks `per block`, not per class. - Sonar Quality Gate
* Puppet Parser
* ERB Template Parser
* Test for unwanted UTF8 files in the Puppet code (see tests/UTF_Files)
* Markdown-lint
* Spellcheck
* Sonar Quality Gate
## Contact Us ## Contact Us
[contact Us](https://confdroid.com/contact/) - [contact Us](https://confdroid.com/contact/)
- [Feedback Portal](https://feedback.confdroid.com/)
## Disclaimer ## Disclaimer

View File

@@ -1,8 +1,8 @@
## ssh_cd::init.pp ## confdroid_ssh::init.pp
# Module name: ssh_cd # Module name: confdroid_ssh
# Author: Arne Teuke (arne_teuke@confdroid.com) # Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class initializes the ssh_cd module # @summary Class initializes the confdroid_ssh module
############################################################################## ##############################################################################
class ssh_cd::init { class confdroid_ssh {
include ssh_cd::params include confdroid_ssh::params
} }

View File

@@ -1,9 +1,9 @@
## ssh_cd::main::config.pp ## confdroid_ssh::main::config.pp
# Module name: ssh_cd # Module name: confdroid_ssh
# Author: Arne Teuke (arne_teuke@confdroid.com) # Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages module logic # @summary Class manages module logic
############################################################################## ##############################################################################
class ssh_cd::main::config ( class confdroid_ssh::main::config (
) inherits ssh_cd::params { ) inherits confdroid_ssh::params {
include ssh_cd::main::service include confdroid_ssh::main::service
} }

View File

@@ -1,11 +1,11 @@
## ssh_cd::main::dirs.pp ## confdroid_ssh::main::dirs.pp
# Module name: ssh_cd # Module name: confdroid_ssh
# Author: Arne Teuke (arne_teuke@confdroid.com) # Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages directories # @summary Class manages directories
############################################################################## ##############################################################################
class ssh_cd::main::dirs ( class confdroid_ssh::main::dirs (
) inherits ssh_cd::params { ) inherits confdroid_ssh::params {
require ssh_cd::main::install require confdroid_ssh::main::install
file { $ssh_etc_path: file { $ssh_etc_path:
ensure => directory, ensure => directory,

View File

@@ -1,11 +1,11 @@
## ssh_cd::main::files.pp ## confdroid_ssh::main::files.pp
# Module name: ssh_cd # Module name: confdroid_ssh
# Author: Arne Teuke (arne_teuke@confdroid.com) # Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages files # @summary Class manages files
############################################################################## ##############################################################################
class ssh_cd::main::files ( class confdroid_ssh::main::files (
) inherits ssh_cd::params { ) inherits confdroid_ssh::params {
require ssh_cd::main::dirs require confdroid_ssh::main::dirs
file { $sshd_config_path: file { $sshd_config_path:
ensure => file, ensure => file,

View File

@@ -1,10 +1,10 @@
## ssh_cd::main::install.pp ## confdroid_ssh::main::install.pp
# Module name: ssh_cd # Module name: confdroid_ssh
# Author: Arne Teuke (arne_teuke@confdroid.com) # Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages installation # @summary Class manages installation
############################################################################## ##############################################################################
class ssh_cd::main::install ( class confdroid_ssh::main::install (
) inherits ssh_cd::params { ) inherits confdroid_ssh::params {
package { $reqpackages: package { $reqpackages:
ensure => $pkg_ensure, ensure => $pkg_ensure,
} }

View File

@@ -1,11 +1,11 @@
## ssh_cd::main::service.pp ## confdroid_ssh::main::service.pp
# Module name: ssh_cd # Module name: confdroid_ssh
# Author: Arne Teuke (arne_teuke@confdroid.com) # Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages service settings # @summary Class manages service settings
############################################################################## ##############################################################################
class ssh_cd::main::service ( class confdroid_ssh::main::service (
) inherits ssh_cd::params { ) inherits confdroid_ssh::params {
require ssh_cd::main::files require confdroid_ssh::main::files
service { $sshd_service: service { $sshd_service:
ensure => running, ensure => running,

View File

@@ -1,22 +1,29 @@
## ssh_cd::params.pp ## confdroid_ssh::params.pp
# Module name: ssh_cd # Module name: confdroid_ssh
# Author: Arne Teuke (arne_teuke@confdroid.com) # Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class contains all class parameters for ssh_cd # @summary Class contains all class parameters for confdroid_ssh
# @param [array] reqpackages packages to install # @param [Array] reqpackages packages to install
# @param [string] pkg_ensure version to install: 'present' or 'latest' # @param [String] pkg_ensure version to install: 'present' or 'latest'
############################################################################## ##############################################################################
class ssh_cd::params ( class confdroid_ssh::params (
Array $reqpackages = ['openssh','openssh-clients','openssh-server'], Array $reqpackages = ['openssh','openssh-clients','openssh-server'],
String $pkg_ensure = 'latest', String $pkg_ensure = 'present',
) { ) {
# default facts
$fqdn = $facts['networking']['fqdn']
$hostname = $facts['networking']['hostname']
$domain = $facts['networking']['domain']
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
$sshd_user = 'root' $sshd_user = 'root'
$ssh_etc_path = '/etc/ssh' $ssh_etc_path = '/etc/ssh'
$sshd_service = 'sshd' $sshd_service = 'sshd'
$sshd_config_path = "${ssh_etc_path}/sshd_config" $sshd_config_path = "${ssh_etc_path}/sshd_config"
$sshd_config_erb = 'ssh_cd/ssh_config.erb' $sshd_config_erb = 'confdroid_ssh/ssh_config.erb'
# includes must be last # includes must be last
include ssh_cd::main::config include confdroid_ssh::main::config
} }

View File

@@ -1,3 +1,10 @@
###############################################################################
##### DO NOT EDIT THIS FILE MANUALLY #
##### This file is managed by Puppet. Any changes to this file will be #
###### overwritten. If you want to change the content of this file, edit the #
##### template ssh_config.erb ##### and then run Puppet to apply the changes. #
###############################################################################
# $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $ # $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $
# This is the sshd server system-wide configuration file. See # This is the sshd server system-wide configuration file. See