Files
confdroid_ssh/manifests/params.pp
2026-04-05 15:52:15 +02:00

47 lines
1.8 KiB
Puppet

## confdroid_ssh::params.pp
# Module name: confdroid_ssh
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class contains all class parameters for confdroid_ssh
# @param [Array] ssh_reqpackages packages to install
# @param [String] pkg_ensure version to install: 'present' or 'latest'
# @param [Boolean] ssh_use_firewall whether to manage firewall settings
# @param [String] ssh_fw_port port to use for SSHD and in fw
# @param [String] ssh_fw_order order of firewall rule
# @param [String] ssh_source_range source range for firewall rule
# @param [Boolean] ssh_manage_config whether to manage the configuration
##############################################################################
class confdroid_ssh::params (
Array $ssh_reqpackages = ['openssh','openssh-clients','openssh-server'],
String $pkg_ensure = 'present',
# firewall settings
Boolean $ssh_use_firewall = true,
String $ssh_fw_port = '22',
String $ssh_fw_order = '50',
String $ssh_source_range = '0.0.0.0/0',
# main configuration
Boolean $ssh_manage_config = true,
) {
# 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'
$ssh_etc_path = '/etc/ssh'
$sshd_service = 'sshd'
$sshd_config_path = "${ssh_etc_path}/sshd_config"
$sshd_custom_path = "${ssh_etc_path}/sshd_config.d"
$sshd_custom_conf = "${sshd_custom_path}/10-custom.conf"
$sshd_custom_erb = 'confdroid_ssh/sshd_custom_conf.erb'
$sshd_config_erb = 'confdroid_ssh/sshd_config.erb'
# includes must be last
include confdroid_ssh::main::config
}