Merge branch 'jenkins-build-7' into 'master'
Auto-merge for build 7 See merge request puppet/confdroid_ssh!7
This commit is contained in:
@@ -35,5 +35,12 @@ class confdroid_ssh::main::files (
|
|||||||
content => template($sshd_custom_erb),
|
content => template($sshd_custom_erb),
|
||||||
notify => Service[$sshd_service],
|
notify => Service[$sshd_service],
|
||||||
}
|
}
|
||||||
|
# we want the default root login setting to be managed by the custom conf,
|
||||||
|
# so we remove the default file if it exists
|
||||||
|
file { $sshd_root_login_file:
|
||||||
|
ensure => absent,
|
||||||
|
path => $sshd_root_login_file,
|
||||||
|
notify => Service[$sshd_service],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
# @param [Boolean] ssh_manage_config whether to manage the configuration
|
# @param [Boolean] ssh_manage_config whether to manage the configuration
|
||||||
# @param [String] ssh_address_family AddressFamily setting for sshd_config
|
# @param [String] ssh_address_family AddressFamily setting for sshd_config
|
||||||
# @param [String] ssh_listen_address ListenAddress setting for sshd_config
|
# @param [String] ssh_listen_address ListenAddress setting for sshd_config
|
||||||
|
# @param [String] ssh_root_login PermitRootLogin setting for sshd_config
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class confdroid_ssh::params (
|
class confdroid_ssh::params (
|
||||||
|
|
||||||
@@ -27,6 +28,7 @@ class confdroid_ssh::params (
|
|||||||
Boolean $ssh_manage_config = true,
|
Boolean $ssh_manage_config = true,
|
||||||
String $ssh_address_family = 'any',
|
String $ssh_address_family = 'any',
|
||||||
String $ssh_listen_address = '0.0.0.0',
|
String $ssh_listen_address = '0.0.0.0',
|
||||||
|
String $ssh_root_login = 'prohibit-password',
|
||||||
|
|
||||||
) {
|
) {
|
||||||
# default facts
|
# default facts
|
||||||
@@ -36,14 +38,15 @@ class confdroid_ssh::params (
|
|||||||
$os_name = $facts['os']['name']
|
$os_name = $facts['os']['name']
|
||||||
$os_release = $facts['os']['release']['major']
|
$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_custom_path = "${ssh_etc_path}/sshd_config.d"
|
$sshd_custom_path = "${ssh_etc_path}/sshd_config.d"
|
||||||
$sshd_custom_conf = "${sshd_custom_path}/10-custom.conf"
|
$sshd_custom_conf = "${sshd_custom_path}/10-custom.conf"
|
||||||
$sshd_custom_erb = 'confdroid_ssh/sshd_custom_conf.erb'
|
$sshd_custom_erb = 'confdroid_ssh/sshd_custom_conf.erb'
|
||||||
$sshd_config_erb = 'confdroid_ssh/sshd_config.erb'
|
$sshd_config_erb = 'confdroid_ssh/sshd_config.erb'
|
||||||
|
$sshd_root_login_file = "${sshd_custom_path}/01-permitrootlogin.conf"
|
||||||
|
|
||||||
# includes must be last
|
# includes must be last
|
||||||
include confdroid_ssh::main::config
|
include confdroid_ssh::main::config
|
||||||
|
|||||||
@@ -8,3 +8,5 @@
|
|||||||
Port <%= @ssh_fw_port %>
|
Port <%= @ssh_fw_port %>
|
||||||
AddressFamily <%= @ssh_address_family %>
|
AddressFamily <%= @ssh_address_family %>
|
||||||
ListenAddress <%= @ssh_listen_address %>
|
ListenAddress <%= @ssh_listen_address %>
|
||||||
|
|
||||||
|
PermitRootLogin <%= @ssh_root_login %>
|
||||||
Reference in New Issue
Block a user