[nginx] Add service_nginx intermediary variable

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
certbot_on_virtu
Yohann D'ANELLO 2021-03-24 14:38:54 +01:00
parent 98263de23f
commit 26e65bb7bc
Signed by: _ynerant
GPG Key ID: 3A75C55819C8CF85
18 changed files with 53 additions and 35 deletions

View File

@ -1,5 +1,5 @@
--- ---
loc_nginx: service_nginx:
service_name: constellation service_name: constellation
ssl: [] ssl: []
servers: servers:

View File

@ -16,7 +16,7 @@ glob_django_cas:
host: "{{ query('ldap', 'ip', 'redisdead', 'adm') | ipv4 | first }}" host: "{{ query('ldap', 'ip', 'redisdead', 'adm') | ipv4 | first }}"
port: 25 port: 25
loc_nginx: service_nginx:
service_name: "cas" service_name: "cas"
ssl: [] ssl: []
servers: servers:

View File

@ -20,5 +20,17 @@ glob_gitlab:
address: "{{ query('ldap', 'ip', 'redisdead', 'adm') | first }}" address: "{{ query('ldap', 'ip', 'redisdead', 'adm') | first }}"
port: 25 port: 25
service_nginx:
ssl:
- name: adm.crans.org
cert: /etc/letsencrypt/live/adm.crans.org/fullchain.pem
cert_key: /etc/letsencrypt/live/adm.crans.org/privkey.pem
trusted_cert: /etc/letsencrypt/live/adm.crans.org/chain.pem
- name: crans.org
cert: /etc/letsencrypt/live/crans.org/fullchain.pem
cert_key: /etc/letsencrypt/live/crans.org/privkey.pem
trusted_cert: /etc/letsencrypt/live/crans.org/chain.pem
servers: []
glob_irker: glob_irker:
name: GitlabBot name: GitlabBot

View File

@ -1,6 +1,6 @@
--- ---
# We use embedded Jitsi configuration # We use embedded Jitsi configuration
loc_nginx: service_nginx:
servers: [] servers: []
glob_jitsi: glob_jitsi:

View File

@ -1,9 +1,14 @@
--- ---
loc_nginx: service_nginx:
service_name: mailman3 service_name: mailman3
upstreams: upstreams:
- name: mailman3 - name: mailman3
server: "unix:/run/mailman3-web/uwsgi.sock fail_timeout=0" server: "unix:/run/mailman3-web/uwsgi.sock fail_timeout=0"
default_server: lists.crans.org
default_ssl_server: lists.crans.org
auth_passwd:
Stop: "$apr1$NXaV5H7Q$J3ora3Jo5h775Y1nm93PN1"
deploy_robots_file: true
servers: servers:
- ssl: false - ssl: false
server_name: server_name:

View File

@ -31,7 +31,7 @@ glob_roundcube:
larry: https://www.crans.org/images/crans_banner.png larry: https://www.crans.org/images/crans_banner.png
classic: https://www.crans.org/images/crans_banner.png classic: https://www.crans.org/images/crans_banner.png
loc_nginx: service_nginx:
service_name: "roundcube" service_name: "roundcube"
ssl: [] ssl: []
servers: servers:

View File

@ -24,3 +24,24 @@ glob_thelounge:
filter: "(objectclass=inetOrgPerson)" filter: "(objectclass=inetOrgPerson)"
base: "dc=crans,dc=org" base: "dc=crans,dc=org"
scope: "sub" scope: "sub"
service_nginx:
service_name: "thelounge"
servers:
- server_name:
- "irc.crans.org"
- "irc"
default: true
ssl: crans.org
locations:
- filter: "^~ /web/"
params:
- "proxy_pass http://localhost:9000/"
- "include \"/etc/nginx/snippets/options-proxypass.conf\""
- filter: "~ ^/$"
params:
- "return 302 https://irc.crans.org/web/"
- filter: "/"
params:
- "return 302 \"https://wiki.crans.org/VieCrans/UtiliserIrc#Via_l.27interface_web\""

View File

@ -2,7 +2,7 @@
glob_moinmoin: glob_moinmoin:
main: false main: false
loc_nginx: service_nginx:
service_name: wiki service_name: wiki
ssl: [] ssl: []
servers: servers:

View File

@ -3,26 +3,6 @@ interfaces:
adm: ens18 adm: ens18
srv: ens19 srv: ens19
loc_nginx:
service_name: "thelounge"
servers:
- server_name:
- "irc.crans.org"
- "irc"
default: true
ssl: crans.org
locations:
- filter: "^~ /web/"
params:
- "proxy_pass http://localhost:9000/"
- "include \"/etc/nginx/snippets/options-proxypass.conf\""
- filter: "~ ^/$"
params:
- "return 302 https://irc.crans.org/web/"
- filter: "/"
params:
- "return 302 \"https://wiki.crans.org/VieCrans/UtiliserIrc#Via_l.27interface_web\""
loc_thelounge: loc_thelounge:
public: "true" public: "true"

View File

@ -5,7 +5,7 @@
- hosts: django_cas - hosts: django_cas
vars: vars:
django_cas: "{{ glob_django_cas | default({}) | combine(loc_django_cas | default({})) }}" django_cas: "{{ glob_django_cas | default({}) | combine(loc_django_cas | default({})) }}"
nginx: "{{ glob_nginx | default({}) | combine(loc_nginx | default({})) }}" nginx: '{{ glob_nginx | default({}) | combine(service_nginx | default({}) | combine(loc_nginx | default({}))) }}'
roles: roles:
- django-cas - django-cas
- nginx - nginx

View File

@ -9,7 +9,7 @@
- hosts: constellation-front - hosts: constellation-front
vars: vars:
constellation: "{{ glob_constellation | combine(loc_constellation | default({}), recursive=True) }}" constellation: "{{ glob_constellation | combine(loc_constellation | default({}), recursive=True) }}"
nginx: "{{ glob_nginx | combine(loc_nginx | default({})) }}" nginx: '{{ glob_nginx | default({}) | combine(service_nginx | default({}) | combine(loc_nginx | default({}))) }}'
roles: roles:
- nginx - nginx
- constellation-front - constellation-front

View File

@ -15,7 +15,7 @@
gitlab: '{{ glob_gitlab | default({}) | combine(loc_gitlab | default({}), recursive=True) }}' gitlab: '{{ glob_gitlab | default({}) | combine(loc_gitlab | default({}), recursive=True) }}'
irker: '{{ glob_irker | default({}) | combine(loc_irker | default({})) }}' irker: '{{ glob_irker | default({}) | combine(loc_irker | default({})) }}'
mirror: '{{ glob_mirror | default({}) | combine(loc_mirror | default({})) }}' mirror: '{{ glob_mirror | default({}) | combine(loc_mirror | default({})) }}'
nginx: '{{ glob_nginx | default({}) | combine(loc_nginx | default({})) }}' nginx: '{{ glob_nginx | default({}) | combine(service_nginx | default({}) | combine(loc_nginx | default({}))) }}'
reverseproxy: '{{ glob_reverseproxy | default({}) | combine(loc_reverseproxy | default({})) }}' reverseproxy: '{{ glob_reverseproxy | default({}) | combine(loc_reverseproxy | default({})) }}'
roles: roles:
- certbot - certbot

View File

@ -9,7 +9,7 @@
- hosts: thelounge,!adh_server - hosts: thelounge,!adh_server
vars: vars:
certbot: '{{ loc_certbot | default(glob_certbot | default([])) }}' certbot: '{{ loc_certbot | default(glob_certbot | default([])) }}'
nginx: '{{ glob_nginx | default({}) | combine(loc_nginx | default({})) }}' nginx: '{{ glob_nginx | default({}) | combine(service_nginx | default({}) | combine(loc_nginx | default({}))) }}'
roles: roles:
- certbot - certbot
- nginx - nginx

View File

@ -3,7 +3,7 @@
- hosts: jitsi - hosts: jitsi
vars: vars:
certbot: '{{ loc_certbot | default(glob_certbot | default([])) }}' certbot: '{{ loc_certbot | default(glob_certbot | default([])) }}'
nginx: '{{ glob_nginx | default({}) | combine(loc_nginx | default({})) }}' nginx: '{{ glob_nginx | default({}) | combine(service_nginx | default({}) | combine(loc_nginx | default({}))) }}'
jitsi: '{{ glob_jitsi | default({}) | combine(loc_jitsi | default({})) }}' jitsi: '{{ glob_jitsi | default({}) | combine(loc_jitsi | default({})) }}'
roles: roles:
- certbot - certbot

View File

@ -5,7 +5,7 @@
vars: vars:
certbot: '{{ loc_certbot | default(glob_certbot | default([])) }}' certbot: '{{ loc_certbot | default(glob_certbot | default([])) }}'
mailman3: '{{ glob_mailman3 | default({}) | combine(loc_mailman3 | default({})) }}' mailman3: '{{ glob_mailman3 | default({}) | combine(loc_mailman3 | default({})) }}'
nginx: '{{ glob_nginx | default({}) | combine(loc_nginx | default({})) }}' nginx: '{{ glob_nginx | default({}) | combine(service_nginx | default({}) | combine(loc_nginx | default({}))) }}'
opendkim: '{{ glob_opendkim | combine(loc_opendkim | default({})) }}' opendkim: '{{ glob_opendkim | combine(loc_opendkim | default({})) }}'
roles: roles:
- certbot - certbot

View File

@ -10,7 +10,7 @@
- hosts: wiki - hosts: wiki
vars: vars:
moinmoin: '{{ glob_moinmoin | default({}) | combine(loc_moinmoin | default({})) }}' moinmoin: '{{ glob_moinmoin | default({}) | combine(loc_moinmoin | default({})) }}'
nginx: '{{ glob_nginx | default({}) | combine(loc_nginx | default({})) }}' nginx: '{{ glob_nginx | default({}) | combine(service_nginx | default({}) | combine(loc_nginx | default({}))) }}'
roles: roles:
- moinmoin - moinmoin
- nginx - nginx

View File

@ -3,7 +3,7 @@
- hosts: reverseproxy - hosts: reverseproxy
vars: vars:
certbot: '{{ loc_certbot | default(glob_certbot | default([])) }}' certbot: '{{ loc_certbot | default(glob_certbot | default([])) }}'
nginx: '{{ glob_nginx | default({}) | combine(loc_nginx | default({})) }}' nginx: '{{ glob_nginx | default({}) | combine(service_nginx | default({}) | combine(loc_nginx | default({}))) }}'
reverseproxy: '{{ glob_reverseproxy | default({}) | combine(loc_reverseproxy | default({})) }}' reverseproxy: '{{ glob_reverseproxy | default({}) | combine(loc_reverseproxy | default({})) }}'
roles: roles:
- certbot - certbot

View File

@ -3,7 +3,7 @@
- hosts: roundcube - hosts: roundcube
vars: vars:
nginx: '{{ glob_nginx | default({}) | combine(loc_nginx | default({})) }}' nginx: '{{ glob_nginx | default({}) | combine(service_nginx | default({}) | combine(loc_nginx | default({}))) }}'
roundcube: '{{ glob_roundcube | default({}) | combine(loc_roundcube | default({})) }}' roundcube: '{{ glob_roundcube | default({}) | combine(loc_roundcube | default({})) }}'
roles: roles:
- roundcube - roundcube