creates the main conffig target and header
This commit is contained in:
@@ -32,12 +32,15 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
INSTALLATION
|
INSTALLATION
|
||||||
* install binaries
|
* install rpm binaries
|
||||||
|
|
||||||
CONFIGURATION
|
CONFIGURATION
|
||||||
|
* manage haproxy user
|
||||||
|
* manage directories (file system permissions, selinux context)
|
||||||
|
* manage files (file system permissions, content, selinux context)
|
||||||
|
|
||||||
SERVICE
|
SERVICE
|
||||||
* manage service
|
* manage haproxy service
|
||||||
|
|
||||||
### Repo Structure
|
### Repo Structure
|
||||||
Repostructure has moved to REPOSTRUCTURE.md in repo.
|
Repostructure has moved to REPOSTRUCTURE.md in repo.
|
||||||
@@ -49,7 +52,7 @@ See the full Puppet documentation in docs/index.html
|
|||||||
All dependencies must be included in the catalogue.
|
All dependencies must be included in the catalogue.
|
||||||
|
|
||||||
* [cd_resources](https://gitlab.confdroid.com/12WW1160/cd_resources) for managing yum base repos
|
* [cd_resources](https://gitlab.confdroid.com/12WW1160/cd_resources) for managing yum base repos
|
||||||
* [cd_certbot](https://gitlab.confdroid.com/12WW1160/certbot) for automating TLS certificates for https
|
* [cd_concat](https://gitlab.confdroid.com/12ww1160/cd_concat) or [concat](https://github.com/puppetlabs/puppetlabs-concat) for managing file fragments
|
||||||
|
|
||||||
### Deployment
|
### Deployment
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,17 @@ class cd_haproxy::main::dirs (
|
|||||||
|
|
||||||
if $fqdn == $hy_host_fqdn {
|
if $fqdn == $hy_host_fqdn {
|
||||||
require cd_haproxy::main::user
|
require cd_haproxy::main::user
|
||||||
|
|
||||||
|
# main dir
|
||||||
|
file { $hy_main_dir:
|
||||||
|
ensure => directory,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0755'.
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => etc_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,5 +26,24 @@ class cd_haproxy::main::files (
|
|||||||
|
|
||||||
if $fqdn == $hy_host_fqdn {
|
if $fqdn == $hy_host_fqdn {
|
||||||
require cd_haproxy::main::dirs
|
require cd_haproxy::main::dirs
|
||||||
|
|
||||||
|
# create the concat target
|
||||||
|
concat {$hy_main_config:
|
||||||
|
ensure => present,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0640',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => etc_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
|
# create the header
|
||||||
|
concat::fragment { 'header':
|
||||||
|
target => $hy_main_config,
|
||||||
|
content => $hy_config_head_erb,
|
||||||
|
order => '001',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,9 +64,11 @@ $hy_user_shell = '/sbin/nologin',
|
|||||||
$hy_service = 'haproxy'
|
$hy_service = 'haproxy'
|
||||||
|
|
||||||
# directories
|
# directories
|
||||||
|
$hy_main_dir = '/etc/haproxy'
|
||||||
|
|
||||||
# files
|
# files
|
||||||
|
$hy_main_config = "${hy_main_dir}/haproxy.cfg"
|
||||||
|
$hy_config_head_erb = 'cd_puppet/haproxy_head.erb'
|
||||||
|
|
||||||
|
|
||||||
# includes must be last
|
# includes must be last
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# Example configuration for a possible web application. See the
|
# Example configuration for a possible web application. See the
|
||||||
# full configuration options online.
|
# full configuration options online.
|
||||||
#
|
#
|
||||||
|
|||||||
5
templates/haproxy_head.erb
Normal file
5
templates/haproxy_head.erb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
###############################################################################
|
||||||
|
##### haproxy.cfg created by puppet through concatenation. manual changes #####
|
||||||
|
##### will be overwritten. original full file available at #####
|
||||||
|
##### https://confdroid.com/2018/12/haproxy-cfg/ #####
|
||||||
|
###############################################################################
|
||||||
Reference in New Issue
Block a user