OP#561 initial commit after fork
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -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
|
||||||
|
|||||||
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@@ -69,7 +69,7 @@ pipeline {
|
|||||||
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
|
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
|
||||||
sh '''
|
sh '''
|
||||||
/opt/sonar-scanner/bin/sonar-scanner \
|
/opt/sonar-scanner/bin/sonar-scanner \
|
||||||
-Dsonar.projectKey=ssh_cd \
|
-Dsonar.projectKey=confdroid_ssh \
|
||||||
-Dsonar.sources=. \
|
-Dsonar.sources=. \
|
||||||
-Dsonar.host.url=https://sonarqube.confdroid.com \
|
-Dsonar.host.url=https://sonarqube.confdroid.com \
|
||||||
-Dsonar.token=$SONAR_TOKEN
|
-Dsonar.token=$SONAR_TOKEN
|
||||||
|
|||||||
36
README.md
36
README.md
@@ -1,12 +1,21 @@
|
|||||||
# Readme
|
# Readme
|
||||||
|
|
||||||
[](https://jenkins.confdroid.com/job/ssh_cd/)
|
[](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,16 +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-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
|
- Puppet Parser
|
||||||
* ERB Template Parser
|
- ERB Template Parser
|
||||||
* Sonar Quality Gate
|
- 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
|
||||||
|
|
||||||
|
|||||||
@@ -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 {
|
class confdroid_ssh {
|
||||||
include ssh_cd::params
|
include confdroid_ssh::params
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user