Commit b22d8541 authored by HgO's avatar HgO
Browse files

Merge branch '136-permettre-plusieurs-domaines-pour-la-meme-app-web-statique' into 'main'

Resolve "Permettre plusieurs domaines pour la même app web statique"

Closes #136

See merge request Neutrinet/infra!150
parents 14bb143c 137915be
Pipeline #670 passed with stage
in 1 minute and 58 seconds
......@@ -128,6 +128,13 @@ haproxy:
healthcheck: true
healthcheck_url: GET /healthcheck
- hostname: cfacile.labriqueinter.net
target:
- web-static.patata.louise.neutri.net
target_port: 80
healthcheck: true
healthcheck_url: GET /healthcheck
- hostname: sync.labriqueinter.net
target:
- web-static.patata.louise.neutri.net
......
......@@ -8,4 +8,7 @@ web_static_domains:
- name: wiki.labriqueinter.net
template: caddy/dokuwiki.j2
- name: labriqueinter.net
alt_domains:
- internetcu.be
- cfacile.labriqueinter.net
template: caddy/labriqueinternet.j2
web_app_domain: example.com
web_app_alt_domains: []
web_app_owner: "{{ web_app_domain | replace('.', '-') }}"
web_app_group: "{{ web_app_owner }}"
web_app_www_dir: /var/www
......
{{ ansible_managed | comment }}
http://{{ web_app_domain }} {
{% for domain in [web_app_domain] + web_app_alt_domains %}
http://{{ domain }}{% if not loop.last %}, {% endif %}
{% endfor %} {
root * {{ web_app_dist_dir | to_json }}
encode gzip
file_server
......
......@@ -5,3 +5,7 @@ web_static_domains:
template: caddy/mediawiki.j2
- name: realms-wiki.example.com
template: caddy/realms-wiki.j2
- name: brique.example.com
alt_domains:
- cube.example.com
template: caddy/labriqueinternet.j2
......@@ -12,4 +12,5 @@
loop_var: domain
vars:
web_app_domain: "{{ domain.name }}"
web_app_caddy_template: "{{ domain.template | default('Caddyfile.j2') }}"
web_app_alt_domains: "{{ domain.alt_domains | default([]) }}"
web_app_caddy_template: "{{ domain.template | default(omit) }}"
{{ ansible_managed | comment }}
http://{{ web_app_domain }} {
{% for domain in [web_app_domain] + web_app_alt_domains %}
http://{{ domain }}{% if not loop.last %}, {% endif %}
{% endfor %} {
root * {{ web_app_dist_dir | to_json }}
encode gzip
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment