Merge branch 'jenkins-build-6' into 'master'
Auto-merge for build 6 See merge request puppet/confdroid_ssh!6
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
- install required binaries
|
- install required binaries
|
||||||
- manage local custom configuration based on parameters, overriding the defaults
|
- manage local custom configuration based on parameters, overriding the defaults
|
||||||
|
- manage selinux rules
|
||||||
- manage service
|
- manage service
|
||||||
- (optional) manage firewall
|
- (optional) manage firewall
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class confdroid_ssh::main::files (
|
|||||||
seltype => etc_t,
|
seltype => etc_t,
|
||||||
seluser => system_u,
|
seluser => system_u,
|
||||||
content => template($sshd_config_erb),
|
content => template($sshd_config_erb),
|
||||||
|
notify => Service[$sshd_service],
|
||||||
}
|
}
|
||||||
|
|
||||||
if $ssh_manage_config {
|
if $ssh_manage_config {
|
||||||
@@ -32,6 +33,7 @@ class confdroid_ssh::main::files (
|
|||||||
seltype => etc_t,
|
seltype => etc_t,
|
||||||
seluser => system_u,
|
seluser => system_u,
|
||||||
content => template($sshd_custom_erb),
|
content => template($sshd_custom_erb),
|
||||||
|
notify => Service[$sshd_service],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
class confdroid_ssh::main::service (
|
class confdroid_ssh::main::service (
|
||||||
) inherits confdroid_ssh::params {
|
) inherits confdroid_ssh::params {
|
||||||
require confdroid_ssh::main::files
|
require confdroid_ssh::main::files
|
||||||
|
require confdroid_ssh::selinux::semanage
|
||||||
if $ssh_use_firewall {
|
if $ssh_use_firewall {
|
||||||
require confdroid_ssh::firewall::iptables
|
require confdroid_ssh::firewall::iptables
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,20 +9,24 @@
|
|||||||
# @param [String] ssh_fw_order order of firewall rule
|
# @param [String] ssh_fw_order order of firewall rule
|
||||||
# @param [String] ssh_source_range source range for firewall rule
|
# @param [String] ssh_source_range source range for firewall rule
|
||||||
# @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_listen_address ListenAddress setting for sshd_config
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class confdroid_ssh::params (
|
class confdroid_ssh::params (
|
||||||
|
|
||||||
Array $ssh_reqpackages = ['openssh','openssh-clients','openssh-server'],
|
Array $ssh_reqpackages = ['openssh','openssh-clients','openssh-server'],
|
||||||
String $pkg_ensure = 'present',
|
String $pkg_ensure = 'present',
|
||||||
|
|
||||||
# firewall settings
|
# firewall settings
|
||||||
Boolean $ssh_use_firewall = true,
|
Boolean $ssh_use_firewall = true,
|
||||||
String $ssh_fw_port = '22',
|
String $ssh_fw_port = '22',
|
||||||
String $ssh_fw_order = '50',
|
String $ssh_fw_order = '50',
|
||||||
String $ssh_source_range = '0.0.0.0/0',
|
String $ssh_source_range = '0.0.0.0/0',
|
||||||
|
|
||||||
# main configuration
|
# main configuration
|
||||||
Boolean $ssh_manage_config = true,
|
Boolean $ssh_manage_config = true,
|
||||||
|
String $ssh_address_family = 'any',
|
||||||
|
String $ssh_listen_address = '0.0.0.0',
|
||||||
|
|
||||||
) {
|
) {
|
||||||
# default facts
|
# default facts
|
||||||
@@ -38,8 +42,8 @@ class confdroid_ssh::params (
|
|||||||
$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/ssh_custom_conf.erb'
|
$sshd_custom_erb = 'confdroid_ssh/sshd_custom_conf.erb'
|
||||||
$sshd_config_erb = 'confdroid_ssh/ssh_config.erb'
|
$sshd_config_erb = 'confdroid_ssh/sshd_config.erb'
|
||||||
|
|
||||||
# includes must be last
|
# includes must be last
|
||||||
include confdroid_ssh::main::config
|
include confdroid_ssh::main::config
|
||||||
|
|||||||
13
manifests/selinux/semanage.pp
Normal file
13
manifests/selinux/semanage.pp
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
## confdroid_ssh::selinux::semanage.pp
|
||||||
|
# Module name: confdroid_ssh
|
||||||
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
|
# @summary Class manages SELinux semanage settings
|
||||||
|
##############################################################################
|
||||||
|
class confdroid_ssh::selinux::semanage (
|
||||||
|
) inherits confdroid_ssh::params {
|
||||||
|
exec { 'semanage_port_ssh':
|
||||||
|
command => "semanage port -a -t ssh_port_t -p tcp ${ssh_fw_port}",
|
||||||
|
unless => "semanage port -l | grep '^ssh_port_t' | grep 'tcp' | grep '${ssh_fw_port}'",
|
||||||
|
path => ['/usr/bin', '/usr/sbin'],
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,3 +5,6 @@
|
|||||||
##### be made in the Puppet manifest parameters. #
|
##### be made in the Puppet manifest parameters. #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
Port <%= @ssh_fw_port %>
|
||||||
|
AddressFamily <%= @ssh_address_family %>
|
||||||
|
ListenAddress <%= @ssh_listen_address %>
|
||||||
Reference in New Issue
Block a user