feat: manage haproxy for stalwart (#420)

- add frontends for imap, imaps and smtp
- add backends for webadmin, imap, imaps and smtp

Reviewed-on: #420
This commit was merged in pull request #420.
This commit is contained in:
2025-11-08 21:07:43 +11:00
parent 1e7dfb9d9d
commit 5b0365c096
4 changed files with 175 additions and 1 deletions
@@ -0,0 +1,59 @@
# enable external access via haproxy
class profiles::stalwart::haproxy (
Boolean $enable = false,
){
# webadmin
profiles::haproxy::balancemember { "${facts['networking']['fqdn']}_443":
service => 'be_stalwart_webadmin',
ports => [443],
options => [
"cookie ${facts['networking']['hostname']}",
'ssl',
'verify none',
'check',
'inter 2s',
'rise 3',
'fall 2',
]
}
# imap
profiles::haproxy::balancemember { "${facts['networking']['fqdn']}_143":
service => 'be_stalwart_imap',
ports => [143],
options => [
'check',
'inter 3s',
'rise 2',
'fall 3',
]
}
# imaps
profiles::haproxy::balancemember { "${facts['networking']['fqdn']}_993":
service => 'be_stalwart_imaps',
ports => [993],
options => [
'check',
'ssl',
'verify none',
'inter 3s',
'rise 2',
'fall 3',
]
}
# smtp
profiles::haproxy::balancemember { "${facts['networking']['fqdn']}_25":
service => 'be_stalwart_smtp',
ports => [25],
options => [
'check',
'inter 3s',
'rise 2',
'fall 3',
]
}
}