feat: add frontends, backends, listeners

- add a way to define frontends, backends and listeners through hieradata
This commit is contained in:
2024-04-06 18:53:53 +11:00
parent cdbb689c91
commit 82f2d75888
6 changed files with 84 additions and 24 deletions
+10 -6
View File
@@ -1,9 +1,13 @@
# profiles::haproxy::mappings
class profiles::haproxy::mappings (
Array $list = []
) {
haproxy::mapfile { 'domains-to-backends':
ensure => 'present',
mappings => $list,
class profiles::haproxy::mappings {
# for each mapping:
$mappings = lookup('profiles::haproxy::mappings')
$mappings.each |$mapping, $data| {
# create mapping
haproxy::mapfile { $mapping:
* => $data,
}
}
}