rewite general
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
## fail2ban_cd::init.pp
|
||||
# Module name: fail2ban_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class initializes the fail2ban_cd module.
|
||||
## confdroid_fail2ban::init.pp
|
||||
# Module name: confdroid_fail2ban
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class initializes the confdroid_fail2ban module.
|
||||
##############################################################################
|
||||
class fail2ban_cd {
|
||||
include fail2ban_cd::params
|
||||
class confdroid_fail2ban {
|
||||
include confdroid_fail2ban::params
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
## fail2ban_cd::main::config.pp
|
||||
# Module name: fail2ban_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class manages the module logic for fail2ban_cd.
|
||||
## confdroid_fail2ban::main::config.pp
|
||||
# Module name: confdroid_fail2ban
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages the module logic for confdroid_fail2ban.
|
||||
##############################################################################
|
||||
class fail2ban_cd::main::config (
|
||||
class confdroid_fail2ban::main::config (
|
||||
|
||||
) inherits fail2ban_cd::params {
|
||||
include fail2ban_cd::main::service
|
||||
) inherits confdroid_fail2ban::params {
|
||||
include confdroid_fail2ban::main::service
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## fail2ban_cd::main::dirs.pp
|
||||
# Module name: fail2ban_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class manages all directories required for fail2ban_cd.
|
||||
## confdroid_fail2ban::main::dirs.pp
|
||||
# Module name: confdroid_fail2ban
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages all directories required for confdroid_fail2ban.
|
||||
###############################################################################
|
||||
class fail2ban_cd::main::dirs (
|
||||
class confdroid_fail2ban::main::dirs (
|
||||
|
||||
) inherits fail2ban_cd::params {
|
||||
require fail2ban_cd::main::install
|
||||
) inherits confdroid_fail2ban::params {
|
||||
require confdroid_fail2ban::main::install
|
||||
|
||||
# manage main dir
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## fail2ban_cd::main::files.pp
|
||||
# Module name: fail2ban_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class manages all configuration files required for fail2ban_cd.
|
||||
## confdroid_fail2ban::main::files.pp
|
||||
# Module name: confdroid_fail2ban
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages all configuration files required for confdroid_fail2ban.
|
||||
##############################################################################
|
||||
class fail2ban_cd::main::files (
|
||||
class confdroid_fail2ban::main::files (
|
||||
|
||||
) inherits fail2ban_cd::params {
|
||||
require fail2ban_cd::main::dirs
|
||||
) inherits confdroid_fail2ban::params {
|
||||
require confdroid_fail2ban::main::dirs
|
||||
|
||||
if $fn_manage_config == true {
|
||||
# manage fail2ban.conf
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
## fail2ban_cd::main::install.pp
|
||||
# Module name: fail2ban_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class installs binaries required for fail2ban_cd
|
||||
## confdroid_fail2ban::main::install.pp
|
||||
# Module name: confdroid_fail2ban
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class installs binaries required for confdroid_fail2ban
|
||||
###############################################################################
|
||||
class fail2ban_cd::main::install (
|
||||
class confdroid_fail2ban::main::install (
|
||||
|
||||
) inherits fail2ban_cd::params {
|
||||
# require cd_resources
|
||||
|
||||
package { $reqpackages:
|
||||
ensure => $pkg_ensure,
|
||||
) inherits confdroid_fail2ban::params {
|
||||
package { $fn_reqpackages:
|
||||
ensure => $fn_pkg_ensure,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## fail2ban_cd::main::service.pp
|
||||
# Module name: fail2ban_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class manages the service(s) for fail2ban_cd.
|
||||
## confdroid_fail2ban::main::service.pp
|
||||
# Module name: confdroid_fail2ban
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages the service(s) for confdroid_fail2ban.
|
||||
#############################################################################
|
||||
class fail2ban_cd::main::service (
|
||||
class confdroid_fail2ban::main::service (
|
||||
|
||||
) inherits fail2ban_cd::params {
|
||||
require fail2ban_cd::main::files
|
||||
) inherits confdroid_fail2ban::params {
|
||||
require confdroid_fail2ban::main::files
|
||||
|
||||
service { $fn_service:
|
||||
ensure => $fn_enable_service,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
## fail2ban_cd::params.pp
|
||||
# Module name: fail2ban_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class holds all parameters for the fail2ban_cd module
|
||||
# @param [String] pkg_ensure
|
||||
## confdroid_fail2ban::params.pp
|
||||
# Module name: confdroid_fail2ban
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class holds all parameters for the confdroid_fail2ban module
|
||||
# @param [String] fn_pkg_ensure
|
||||
# which [package type](https://confdroid.com/2017/05/puppet-type-package/)
|
||||
# to choose, i.e. `latest` or `present`.
|
||||
# @param [array] reqpackages the packages to install.
|
||||
# @param [array] fn_reqpackages the packages to install.
|
||||
# @param [boolean] fn_manage_config Whether to manage the fail2ban
|
||||
# configuration files. If set to false, fail2ban will be installed, but the
|
||||
# configuration will not be managed.
|
||||
@@ -101,11 +101,11 @@
|
||||
# @param [String] fn_default_action Choose default action.
|
||||
# @param [String] fn_jail_paths the fail path. defaults to fedora.
|
||||
###############################################################################
|
||||
class fail2ban_cd::params (
|
||||
class confdroid_fail2ban::params (
|
||||
|
||||
# installation
|
||||
String $pkg_ensure = 'latest',
|
||||
Array $reqpackages = ['fail2ban','fail2ban-firewalld',
|
||||
String $fn_pkg_ensure = 'present',
|
||||
Array $fn_reqpackages = ['fail2ban','fail2ban-firewalld',
|
||||
'fail2ban-sendmail','fail2ban-server.noarch','whois'],
|
||||
|
||||
Boolean $fn_manage_config = true,
|
||||
@@ -176,17 +176,17 @@ class fail2ban_cd::params (
|
||||
|
||||
# files
|
||||
$fn_fail2ban_conf_file = "${fn_main_dir}/fail2ban.conf"
|
||||
$fn_fail2ban_conf_erb = 'fail2ban_cd/fail2ban_conf.erb'
|
||||
$fn_fail2ban_conf_erb = 'confdroid_fail2ban/fail2ban_conf.erb'
|
||||
$fn_fail2ban_local_file = "${fn_main_dir}/fail2ban.local"
|
||||
$fn_fail2ban_local_erb = 'fail2ban_cd/fail2ban_local.erb'
|
||||
$fn_fail2ban_local_erb = 'confdroid_fail2ban/fail2ban_local.erb'
|
||||
$fn_jail_conf_file = "${fn_main_dir}/jail.conf"
|
||||
$fn_jail_conf_erb = 'fail2ban_cd/jail_conf.erb'
|
||||
$fn_jail_conf_erb = 'confdroid_fail2ban/jail_conf.erb'
|
||||
$fn_jail_local_file = "${fn_main_dir}/jail.local"
|
||||
$fn_jail_local_erb = 'fail2ban_cd/jail_local.erb'
|
||||
$fn_jail_local_erb = 'confdroid_fail2ban/jail_local.erb'
|
||||
$fn_paths_common_file = "${fn_main_dir}/paths-common.conf"
|
||||
$fn_paths_common_erb = 'fail2ban_cd/paths_common_conf.erb'
|
||||
$fn_paths_common_erb = 'confdroid_fail2ban/paths_common_conf.erb'
|
||||
|
||||
# includes must be last
|
||||
|
||||
include fail2ban_cd::main::config
|
||||
include confdroid_fail2ban::main::config
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user