feat: add frontends, backends, listeners
- add a way to define frontends, backends and listeners through hieradata
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# profiles::haproxy::backends
|
||||
class profiles::haproxy::backends {
|
||||
# set location_environment
|
||||
$location_environment = "${facts['country']}-${facts['region']}-${facts['environment']}"
|
||||
|
||||
# for each backend:
|
||||
$backends = lookup('profiles::haproxy::backends', Hash, 'deep', {})
|
||||
$backends.each |$backend, $data| {
|
||||
|
||||
# create backend
|
||||
haproxy::backend { $backend:
|
||||
* => $data,
|
||||
}
|
||||
|
||||
# collect exported resources
|
||||
$tag = "${backend}_${location_environment}"
|
||||
Haproxy::Balancermember <<| tag == $tag |>>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user