diff options
| author | Joe Carstairs <me@joeac.net> | 2026-08-06 13:54:51 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-08-06 13:54:51 +0100 |
| commit | 70a1927fd05e6127a5fd28ed944528b0176cedd6 (patch) | |
| tree | 88e59b6b53e95562924965480916fdc693e3bcff | |
| parent | 832f232972c65e7ebed62000aefe825cf8d8ff38 (diff) | |
simply domains.conf with jinja selectattr
| -rw-r--r-- | ansible/roles/mox/templates/domains.conf | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/ansible/roles/mox/templates/domains.conf b/ansible/roles/mox/templates/domains.conf index 6cbe58f..dad978c 100644 --- a/ansible/roles/mox/templates/domains.conf +++ b/ansible/roles/mox/templates/domains.conf @@ -53,10 +53,7 @@ MonitorDNSBLs: WebHandlers: -{% for subdomain in subdomains %} -{% if subdomain.mox_handler != "none" %} - -{% if subdomain.mox_handler == "static" %} +{% for subdomain in ( subdomains | selectattr("mox_handler", "eq", "static") ) %} - LogName: {{ subdomain.name }}.joeac.net PathRegexp: ^/ @@ -84,8 +81,9 @@ WebHandlers: WebRedirect: OrigPathRegexp: ^(.*)/index.html$ ReplacePath: $1.html +{% endfor %} -{% elif subdomain.mox_handler == "forward" %} +{% for subdomain in ( subdomains | selectattr("mox_handler", "eq", "forward") ) %} - LogName: {{ subdomain.name }}.joeac.net PathRegexp: ^/ @@ -93,7 +91,4 @@ WebHandlers: Domain: {{ subdomain.full_domain }} WebForward: URL: http://{{ hostvars[services[subdomain.service].host].ansible_host }}:{{ services[subdomain.service].port }} -{% endif %} - -{% endif %} {% endfor %} |
