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

35 lines
1.1 KiB
YAML

- name: Copy webroot files
copy: src=public_html dest=/srv owner=root group=root mode=0644 directory_mode=0755
- name: Install public_html scripts
template: src=generate-public_html.j2 dest=/usr/local/bin/generate-public_html owner=root group=root mode=0755
- name: Install public_html units
copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
loop:
- generate-public_html.timer
- generate-public_html.service
- name: Start and enable public_html units
service: name={{ item }} enabled=yes state=started
loop:
- generate-public_html.timer
- generate-public_html.service
- name: Setup HTTP redirect
include_role:
name: http_redirect
vars:
domain: "{{ public_domain }}"
additional_domains: ["www.{{ public_domain }}"]
- name: Make nginx log dir
file: path=/var/log/nginx/{{ public_domain }} state=directory owner=root group=root mode=0755
- name: Set up nginx
template: src=nginx.d.conf.j2 dest=/etc/nginx/nginx.d/public_html.conf owner=root group=root mode=0644
notify:
- Reload nginx
tags: ['nginx']