OP#669 initial commit with new autolayout
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
## haproxy_cd::firewall::iptables.pp
|
||||
# Module name: haproxy_cd
|
||||
## confdroid_haproxy::firewall::iptables.pp
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary manage firewall settings through cd_firewall or puppetlabs-firewall
|
||||
###############################################################################
|
||||
class haproxy_cd::firewall::iptables (
|
||||
class confdroid_haproxy::firewall::iptables (
|
||||
|
||||
) inherits haproxy_cd::params {
|
||||
) inherits confdroid_haproxy::params {
|
||||
if ($fqdn == $hy_host_fqdn) and ($hy_manage_fw == true) {
|
||||
firewall { "${hy_fw_order_no}${hy_http_port} tcp port ${hy_http_port}":
|
||||
proto => 'tcp',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
## haproxy_cd::init.pp
|
||||
# Module name: haproxy_cd
|
||||
## confdroid_haproxy::init.pp
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class initializes the haproxy_cd module.
|
||||
# @summary Class initializes the confdroid_haproxy module.
|
||||
##############################################################################
|
||||
class haproxy_cd {
|
||||
include haproxy_cd::params
|
||||
class confdroid_haproxy {
|
||||
include confdroid_haproxy::params
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
## haproxy_cd::main::config.pp
|
||||
# Module name: haproxy_cd
|
||||
## confdroid_haproxy::main::config.pp
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class manages module logic for haproxy_cd.
|
||||
# @summary Class manages module logic for confdroid_haproxy.
|
||||
##############################################################################
|
||||
class haproxy_cd::main::config (
|
||||
class confdroid_haproxy::main::config (
|
||||
|
||||
) inherits haproxy_cd::params {
|
||||
include haproxy_cd::server::service
|
||||
) inherits confdroid_haproxy::params {
|
||||
include confdroid_haproxy::server::service
|
||||
|
||||
if $hy_manage_fail2ban == true {
|
||||
include haproxy_cd::monitoring::fail2ban
|
||||
include confdroid_haproxy::monitoring::fail2ban
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## haproxy_cd::main::dirs.pp
|
||||
# Module name: haproxy_cd
|
||||
## confdroid_haproxy::main::dirs.pp
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class manages all directories required for haproxy_cd.
|
||||
# @summary Class manages all directories required for confdroid_haproxy.
|
||||
###############################################################################
|
||||
class haproxy_cd::main::dirs (
|
||||
class confdroid_haproxy::main::dirs (
|
||||
|
||||
) inherits haproxy_cd::params {
|
||||
) inherits confdroid_haproxy::params {
|
||||
if $fqdn == $hy_host_fqdn {
|
||||
require haproxy_cd::main::user
|
||||
require confdroid_haproxy::main::user
|
||||
|
||||
# main dir
|
||||
file { $hy_main_dir:
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## haproxy_cd::main::files.pp
|
||||
# Module name: haproxy_cd
|
||||
## confdroid_haproxy::main::files.pp
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class manages all configuration files required for haproxy_cd.
|
||||
# @summary Class manages all configuration files required for confdroid_haproxy.
|
||||
##############################################################################
|
||||
class haproxy_cd::main::files (
|
||||
class confdroid_haproxy::main::files (
|
||||
|
||||
) inherits haproxy_cd::params {
|
||||
) inherits confdroid_haproxy::params {
|
||||
if $fqdn == $hy_host_fqdn {
|
||||
require haproxy_cd::main::dirs
|
||||
require confdroid_haproxy::main::dirs
|
||||
|
||||
# create the concat target
|
||||
concat { $hy_main_config:
|
||||
@@ -151,7 +151,7 @@ class haproxy_cd::main::files (
|
||||
selrole => object_r,
|
||||
seltype => syslog_conf_t,
|
||||
seluser => system_u,
|
||||
content => template('haproxy_cd/rsyslog/10_haproxy.conf.erb'),
|
||||
content => template('confdroid_haproxy/rsyslog/10_haproxy.conf.erb'),
|
||||
# notify => Service['rsyslog'], # only if using rsyslog_cd module
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
## haproxy_cd::main::install.pp
|
||||
# Module name: haproxy_cd
|
||||
## confdroid_haproxy::main::install.pp
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class installs binaries required for haproxy_cd
|
||||
# @summary Class installs binaries required for confdroid_haproxy
|
||||
###############################################################################
|
||||
class haproxy_cd::main::install (
|
||||
class confdroid_haproxy::main::install (
|
||||
|
||||
) inherits haproxy_cd::params {
|
||||
) inherits confdroid_haproxy::params {
|
||||
if $fqdn == $hy_host_fqdn {
|
||||
package { $reqpackages:
|
||||
ensure => $pkg_ensure,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## haproxy_cd::main::user.pp
|
||||
# Module name: haproxy_cd
|
||||
## confdroid_haproxy::main::user.pp
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# @summary Class manages service users for haproxy_cd.
|
||||
# @summary Class manages service users for confdroid_haproxy.
|
||||
#############################################################################
|
||||
class haproxy_cd::main::user (
|
||||
class confdroid_haproxy::main::user (
|
||||
|
||||
) inherits haproxy_cd::params {
|
||||
) inherits confdroid_haproxy::params {
|
||||
if $fqdn == $hy_host_fqdn {
|
||||
require haproxy_cd::main::install
|
||||
require confdroid_haproxy::main::install
|
||||
|
||||
# manage user
|
||||
user { $hy_user_name:
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Module name: haproxy_cd
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class manages fail2ban settings
|
||||
##############################################################################
|
||||
class haproxy_cd::monitoring::fail2ban (
|
||||
class confdroid_haproxy::monitoring::fail2ban (
|
||||
|
||||
) inherits haproxy_cd::params {
|
||||
) inherits confdroid_haproxy::params {
|
||||
if $hy_manage_fail2ban == true {
|
||||
require confdroid_fail2ban # (external module)
|
||||
|
||||
@@ -19,7 +19,7 @@ class haproxy_cd::monitoring::fail2ban (
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template('haproxy_cd/fail2ban/f2b_haproxy.conf.erb'),
|
||||
content => template('confdroid_haproxy/fail2ban/f2b_haproxy.conf.erb'),
|
||||
notify => Service['fail2ban'],
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class haproxy_cd::monitoring::fail2ban (
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template('haproxy_cd/fail2ban/010_jail.d_haproxy.conf.erb'),
|
||||
content => template('confdroid_haproxy/fail2ban/010_jail.d_haproxy.conf.erb'),
|
||||
notify => Service['fail2ban'],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## haproxy_cd::params.pp
|
||||
# Module name: haproxy_cd
|
||||
## confdroid_haproxy::params.pp
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @param [String] pkg_ensure
|
||||
# which [package type](https://confdroid.com/2017/05/puppet-type-package/)
|
||||
@@ -55,7 +55,7 @@
|
||||
# @param [String] hy_be_userlist backend userlist comment
|
||||
# @param [Boolean] hy_manage_be_users whether to manage backend users
|
||||
###############################################################################
|
||||
class haproxy_cd::params (
|
||||
class confdroid_haproxy::params (
|
||||
|
||||
String $pkg_ensure = 'latest',
|
||||
Array $reqpackages = ['haproxy','httpd-tools'],
|
||||
@@ -124,23 +124,23 @@ class haproxy_cd::params (
|
||||
|
||||
# files
|
||||
$hy_main_config = "${hy_main_dir}/haproxy.cfg"
|
||||
$hy_config_head_erb = 'haproxy_cd/haproxy_head.erb'
|
||||
$hy_config_tail_erb = 'haproxy_cd/haproxy_tail.erb'
|
||||
$hy_config_head_erb = 'confdroid_haproxy/haproxy_head.erb'
|
||||
$hy_config_tail_erb = 'confdroid_haproxy/haproxy_tail.erb'
|
||||
$hy_400_file = "${hy_errors_dir}/400.http"
|
||||
$hy_400_erb = 'haproxy_cd/errors/400_http.erb'
|
||||
$hy_400_erb = 'confdroid_haproxy/errors/400_http.erb'
|
||||
$hy_403_file = "${hy_errors_dir}/403.http"
|
||||
$hy_403_erb = 'haproxy_cd/errors/403_http.erb'
|
||||
$hy_403_erb = 'confdroid_haproxy/errors/403_http.erb'
|
||||
$hy_408_file = "${hy_errors_dir}/408.http"
|
||||
$hy_408_erb = 'haproxy_cd/errors/408_http.erb'
|
||||
$hy_408_erb = 'confdroid_haproxy/errors/408_http.erb'
|
||||
$hy_500_file = "${hy_errors_dir}/500.http"
|
||||
$hy_500_erb = 'haproxy_cd/errors/500_http.erb'
|
||||
$hy_500_erb = 'confdroid_haproxy/errors/500_http.erb'
|
||||
$hy_502_file = "${hy_errors_dir}/502.http"
|
||||
$hy_502_erb = 'haproxy_cd/errors/502_http.erb'
|
||||
$hy_502_erb = 'confdroid_haproxy/errors/502_http.erb'
|
||||
$hy_503_file = "${hy_errors_dir}/503.http"
|
||||
$hy_503_erb = 'haproxy_cd/errors/503_http.erb'
|
||||
$hy_503_erb = 'confdroid_haproxy/errors/503_http.erb'
|
||||
$hy_504_file = "${hy_errors_dir}/504.http"
|
||||
$hy_504_erb = 'haproxy_cd/errors/504_http.erb'
|
||||
$hy_504_erb = 'confdroid_haproxy/errors/504_http.erb'
|
||||
|
||||
# includes must be last
|
||||
include haproxy_cd::main::config
|
||||
include confdroid_haproxy::main::config
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## haproxy_cd::server::proxy.pp
|
||||
# Module name: haproxy_cd
|
||||
## confdroid_haproxy::server::proxy.pp
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# @summary Define manages the proxies for haproxy_cd.
|
||||
# @summary Define manages the proxies for confdroid_haproxy.
|
||||
# @param [String] haproxy_fqdn the fqdn of the haproxy server in question.
|
||||
# @param [String] frontend_name the name for the frontend section rule.
|
||||
# @param [String] frontend_order where the concat should appear in the file.
|
||||
@@ -31,7 +31,7 @@
|
||||
# @param [String] be_http_request value for a backend http request
|
||||
# @param [String] be_acl_rule value for a backend acl rule
|
||||
###############################################################################
|
||||
define haproxy_cd::server::proxy (
|
||||
define confdroid_haproxy::server::proxy (
|
||||
|
||||
String $haproxy_fqdn = undef,
|
||||
String $frontend_name = undef,
|
||||
@@ -63,9 +63,9 @@ define haproxy_cd::server::proxy (
|
||||
$fqdn = $facts['networking']['fqdn']
|
||||
|
||||
$hy_main_config = '/etc/haproxy/haproxy.cfg'
|
||||
$hy_frontendrule = 'haproxy_cd/haproxy_frontend_rule.erb'
|
||||
$hy_backendrule = 'haproxy_cd/haproxy_backend_rule.erb'
|
||||
$hy_acl_rule = 'haproxy_cd/haproxy_acl_rule.erb'
|
||||
$hy_frontendrule = 'confdroid_haproxy/haproxy_frontend_rule.erb'
|
||||
$hy_backendrule = 'confdroid_haproxy/haproxy_backend_rule.erb'
|
||||
$hy_acl_rule = 'confdroid_haproxy/haproxy_acl_rule.erb'
|
||||
|
||||
# Ensure acl_rule_front and acl_rule_back are arrays
|
||||
$acl_rule_front_array = split($acl_rule_front, ';')
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
## haproxy_cd::server::service.pp
|
||||
# Module name: haproxy_cd
|
||||
## confdroid_haproxy::server::service.pp
|
||||
# Module name: confdroid_haproxy
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class manages the service(s) for haproxy_cd.
|
||||
# @summary Class manages the service(s) for confdroid_haproxy.
|
||||
#############################################################################
|
||||
class haproxy_cd::server::service (
|
||||
class confdroid_haproxy::server::service (
|
||||
|
||||
) inherits haproxy_cd::params {
|
||||
) inherits confdroid_haproxy::params {
|
||||
if $fqdn == $hy_host_fqdn {
|
||||
require haproxy_cd::firewall::iptables
|
||||
require haproxy_cd::main::files
|
||||
require confdroid_haproxy::firewall::iptables
|
||||
require confdroid_haproxy::main::files
|
||||
|
||||
service { $hy_service:
|
||||
ensure => running,
|
||||
|
||||
Reference in New Issue
Block a user