Compare commits
1 Commits
f432c7b450
...
f281c5356f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f281c5356f |
@@ -26,7 +26,6 @@
|
||||
|
||||
- install required binaries
|
||||
- manage local custom configuration based on parameters, overriding the defaults
|
||||
- manage selinux rules
|
||||
- manage service
|
||||
- (optional) manage firewall
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ class confdroid_ssh::main::files (
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($sshd_config_erb),
|
||||
notify => Service[$sshd_service],
|
||||
}
|
||||
|
||||
if $ssh_manage_config {
|
||||
@@ -33,7 +32,6 @@ class confdroid_ssh::main::files (
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($sshd_custom_erb),
|
||||
notify => Service[$sshd_service],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
class confdroid_ssh::main::service (
|
||||
) inherits confdroid_ssh::params {
|
||||
require confdroid_ssh::main::files
|
||||
require confdroid_ssh::selinux::semanage
|
||||
if $ssh_use_firewall {
|
||||
require confdroid_ssh::firewall::iptables
|
||||
}
|
||||
|
||||
@@ -9,24 +9,20 @@
|
||||
# @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
|
||||
# @param [String] ssh_address_family AddressFamily setting for sshd_config
|
||||
# @param [String] ssh_listen_address ListenAddress setting for sshd_config
|
||||
##############################################################################
|
||||
class confdroid_ssh::params (
|
||||
|
||||
Array $ssh_reqpackages = ['openssh','openssh-clients','openssh-server'],
|
||||
String $pkg_ensure = 'present',
|
||||
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',
|
||||
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,
|
||||
String $ssh_address_family = 'any',
|
||||
String $ssh_listen_address = '0.0.0.0',
|
||||
Boolean $ssh_manage_config = true,
|
||||
|
||||
) {
|
||||
# default facts
|
||||
@@ -42,8 +38,8 @@ class confdroid_ssh::params (
|
||||
$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'
|
||||
$sshd_custom_erb = 'confdroid_ssh/ssh_custom_conf.erb'
|
||||
$sshd_config_erb = 'confdroid_ssh/ssh_config.erb'
|
||||
|
||||
# includes must be last
|
||||
include confdroid_ssh::main::config
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
## 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,6 +5,3 @@
|
||||
##### 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