Files
Mark HegrebergandChristian Heusel 410f59cb5a apply http_redirect role to our nginx
these are all the systems that the new redirect snippet can be cleanly
applied to. there are a few others not included, that will need a more
manual approach:
 - gitlab (multiple domains)
 - mta.sts(multiple domains)
 - archweb(mutltiple domains, snippets)
 - buildbtw(dynamic dev domains)
 - redirects(different structure)
 - public html(multiple domains)
 - archweb maintenence(different structure)
 - maintenence(different structure)

some of these might be solvable by tweaking the snippet to accept
multiple domains. I'll look into this

Co-authored-by: Christian Heusel <christian@heusel.eu>
2026-03-04 00:52:19 +01:00

16 lines
610 B
YAML

- name: Setup HTTP redirect
include_role:
name: http_redirect
vars:
domain: "mta-sts.{{ (mta_sts | map(attribute='domains') | flatten)[0] }}"
additional_domains: "{{ (mta_sts | map(attribute='domains') | flatten | map('regex_replace', '^', 'mta-sts.'))[1:] }}"
- name: Make nginx log dir
file: path=/var/log/nginx/{{ "mta-sts." + item.domains | first }} state=directory owner=root group=root mode=0755
loop: "{{ mta_sts }}"
- name: Set up nginx
template: src=nginx.d.conf.j2 dest="/etc/nginx/nginx.d/mta-sts.conf" owner=root group=root mode=644
notify: Reload nginx
tags: ['nginx']