feat: add frontends, backends, listeners
- add a way to define frontends, backends and listeners through hieradata
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
class profiles::haproxy::server (
|
||||
Hash $globals = {},
|
||||
Hash $defaults = {},
|
||||
Array $cnames = [],
|
||||
){
|
||||
|
||||
# default global/defaults arrays
|
||||
@@ -52,19 +51,8 @@ class profiles::haproxy::server (
|
||||
include profiles::haproxy::fe_http # default http frontend
|
||||
include profiles::haproxy::fe_https # default https frontend
|
||||
include profiles::haproxy::dns # manage dns for haproxy
|
||||
include profiles::haproxy::frontends # create frontends
|
||||
include profiles::haproxy::backends # create backends
|
||||
include profiles::haproxy::listeners # create listeners
|
||||
|
||||
# for each backend:
|
||||
$backends = lookup('profiles::haproxy::backends')
|
||||
$backends.each |$backend, $data| {
|
||||
|
||||
# create backend
|
||||
haproxy::backend { $backend:
|
||||
* => $data,
|
||||
}
|
||||
|
||||
# collect exported resources
|
||||
$location_environment = "${facts['country']}-${facts['region']}-${facts['environment']}"
|
||||
$tag = "${backend}_${location_environment}"
|
||||
Haproxy::Balancermember <<| tag == $tag |>>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user