Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 014c663e30 | |||
| 541e3672b7 | |||
| ad2428456a | |||
| 7df6938b04 |
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -4,11 +4,15 @@
|
|||||||
"dontlognull",
|
"dontlognull",
|
||||||
"dport",
|
"dport",
|
||||||
"forwardfor",
|
"forwardfor",
|
||||||
|
"getsebool",
|
||||||
"httplog",
|
"httplog",
|
||||||
"managehome",
|
"managehome",
|
||||||
"maxconn",
|
"maxconn",
|
||||||
|
"nagiosadmin",
|
||||||
"nologin",
|
"nologin",
|
||||||
|
"onlyif",
|
||||||
"pidfile",
|
"pidfile",
|
||||||
|
"procs",
|
||||||
"redispatch",
|
"redispatch",
|
||||||
"roundrobin",
|
"roundrobin",
|
||||||
"sess",
|
"sess",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Readme
|
# Readme
|
||||||
|
|
||||||
[](https://jenkins.confdroid.com/job/confdroid_haproxy/)
|
[](https://jenkins.confdroid.com/job/confdroid_haproxy/)
|
||||||
|
[](https://sonarqube.confdroid.com/dashboard?id=confdroid_haproxy)
|
||||||
|
[](https://deepwiki.com/grizzlycoda/puppet_collection)
|
||||||
|
|
||||||
- [Readme](#readme)
|
- [Readme](#readme)
|
||||||
- [Synopsis](#synopsis)
|
- [Synopsis](#synopsis)
|
||||||
@@ -45,6 +47,7 @@ CONFIGURATION
|
|||||||
- ACL options
|
- ACL options
|
||||||
- adds haproxy logs to rsyslog for remote logging where used
|
- adds haproxy logs to rsyslog for remote logging where used
|
||||||
- manage fail2ban integration (optional, requires `confdroid_fail2ban` module)
|
- manage fail2ban integration (optional, requires `confdroid_fail2ban` module)
|
||||||
|
- manage nagios integration (optional, requires `confdroid-nagios` module)
|
||||||
|
|
||||||
SERVICE
|
SERVICE
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,14 @@ class confdroid_haproxy::main::config (
|
|||||||
include confdroid_haproxy::monitoring::fail2ban
|
include confdroid_haproxy::monitoring::fail2ban
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $hy_manage_nagios == true {
|
||||||
|
include confdroid_haproxy::monitoring::target
|
||||||
|
}
|
||||||
|
|
||||||
if $hy_selinux_allow_stats == true {
|
if $hy_selinux_allow_stats == true {
|
||||||
exec { 'setsebool haproxy_connect_any on':
|
exec { 'setsebool haproxy_connect_any on':
|
||||||
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'],
|
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'],
|
||||||
|
onlyif => '/usr/sbin/getsebool haproxy_connect_any | /usr/bin/grep -q " --> off$"',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23
manifests/monitoring/target.pp
Normal file
23
manifests/monitoring/target.pp
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
## confdroid_haproxy::monitoring::target.pp
|
||||||
|
# Module name: confdroid_haproxy
|
||||||
|
# Author: 12ww1160 (12ww1160@puppetsoft.com)
|
||||||
|
# @summary class manages exports for nagios monitoring
|
||||||
|
##############################################################################
|
||||||
|
class confdroid_haproxy::monitoring::target (
|
||||||
|
|
||||||
|
) inherits confdroid_haproxy::params {
|
||||||
|
if $hy_manage_nagios == true {
|
||||||
|
@@nagios_service { "check_haproxy_${fqdn}":
|
||||||
|
check_command => "check_nrpe!check_haproxy!${hy_procs_allowed}!haproxy",
|
||||||
|
use => 'generic-service',
|
||||||
|
host_name => $fqdn,
|
||||||
|
notification_period => '24x7',
|
||||||
|
service_description => "${fqdn}_check_haproxy",
|
||||||
|
target => $hy_target_service,
|
||||||
|
owner => 'nagios',
|
||||||
|
group => 'nagios',
|
||||||
|
mode => '0640',
|
||||||
|
contacts => $hy_target_contacts,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -55,6 +55,9 @@
|
|||||||
# @param [Boolean] hy_manage_be_users whether to manage backend users
|
# @param [Boolean] hy_manage_be_users whether to manage backend users
|
||||||
# @param [Boolean] hy_selinux_allow_stats whether to allow stats in selinux
|
# @param [Boolean] hy_selinux_allow_stats whether to allow stats in selinux
|
||||||
# @param [String] hy_stats_port the port to use for stats. used in firewall settings
|
# @param [String] hy_stats_port the port to use for stats. used in firewall settings
|
||||||
|
# @param [Boolean] hy_manage_nagios whether to manage nagios service checks
|
||||||
|
# @param [String] hy_target_service the path to the nagios service check file
|
||||||
|
# @param [Array] hy_target_contacts the contacts to use for nagios service checks
|
||||||
###############################################################################
|
###############################################################################
|
||||||
class confdroid_haproxy::params (
|
class confdroid_haproxy::params (
|
||||||
|
|
||||||
@@ -115,6 +118,12 @@ class confdroid_haproxy::params (
|
|||||||
Boolean $hy_manage_be_users = false,
|
Boolean $hy_manage_be_users = false,
|
||||||
String $hy_be_userlist = '####',
|
String $hy_be_userlist = '####',
|
||||||
|
|
||||||
|
# nagios
|
||||||
|
Boolean $hy_manage_nagios = false,
|
||||||
|
String $hy_target_service = '/etc/nagios/conf.d/haproxy_service.cfg',
|
||||||
|
Array $hy_target_contacts = ['nagiosadmin'],
|
||||||
|
String $hy_procs_allowed = '1:1'
|
||||||
|
|
||||||
) {
|
) {
|
||||||
$fqdn = $facts['networking']['fqdn']
|
$fqdn = $facts['networking']['fqdn']
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user