Browse Source

weblate: use weblate-service-group instead of weblate-host

Fixes: main/infrastructure#239
keep-around/9e17cda8cac582cf5087ddc169a72ca64ed19d1e
Loïc Dachary 12 months ago
committed by Loic Dachary
parent
commit
7dcd2d34d5
Signed by: dachary GPG Key ID: 992D23B392F9E4F2
  1. 2
      inventory/host_vars/weblate-host/weblate.yml
  2. 3
      inventory/services.yml
  3. 4
      playbooks/weblate/inventory/services.yml
  4. 2
      playbooks/weblate/roles/weblate/templates/docker-compose-infrastructure.yml
  5. 36
      playbooks/weblate/weblate-playbook.yml

2
inventory/host_vars/weblate-host/weblate.yml

@ -1,2 +0,0 @@
---
weblate_vhost_fqdn: weblate.{{ domain }}

3
inventory/services.yml

@ -79,8 +79,7 @@ gitlab-service-hosts:
essential-service-group:
weblate-service-group:
hosts:
weblate-host:
hosts: {}
weblate-service-hosts:
children:

4
playbooks/weblate/inventory/services.yml

@ -6,3 +6,7 @@ icinga-service-group:
postfix-service-group:
hosts:
postfix-host:
weblate-service-group:
hosts:
weblate-host:

2
playbooks/weblate/roles/weblate/templates/docker-compose-infrastructure.yml

@ -27,7 +27,7 @@ services:
- WEBLATE_ADMIN_PASSWORD={{ weblate_admin_password }}
- WEBLATE_DEBUG=0
- WEBLATE_ENABLE_HTTPS=1
- WEBLATE_ALLOWED_HOSTS={{ weblate_vhost_fqdn }},{{ hostvars["weblate-host"]["ansible_host"] }}
- WEBLATE_ALLOWED_HOSTS=weblate.{{ domain }},{{ hostvars[groups["weblate-service-group"][0]]["ansible_host"] }}
- WEBLATE_REGISTRATION_OPEN=1
database:
image: postgres:9.6-alpine

36
playbooks/weblate/weblate-playbook.yml

@ -1,6 +1,36 @@
---
- name: firewall for web
hosts: localhost
gather_facts: false
tasks:
- include_role:
name: firewall
vars:
firewall_server: "{{ item }}"
firewall_clients: [ 0.0.0.0/0 ]
firewall_protocols: [ tcp ]
firewall_ports: [ 80, 443 ]
when: hostvars[item].ansible_host is defined
with_items: "{{ groups['weblate-service-group'] | default([]) }}"
- name: setup weblate DNS
hosts: weblate-service-group
become: true
pre_tasks:
- name: set CNAME
nsupdate:
server: "{{ hostvars['bind-host']['ansible_host'] }}"
zone: "{{ domain }}"
record: "weblate.{{ domain }}."
ttl: 1800
type: CNAME
value: "{{ groups['weblate-service-group'][0] }}.{{ domain }}."
delegate_to: bind-host
- name: install weblate
hosts: weblate-host
hosts: weblate-service-group
become: true
roles:
@ -14,11 +44,11 @@
- role: enough-nginx
vars:
enough_nginx_reverse_proxy: 127.0.0.1:8000
enough_nginx_fqdn: "{{ weblate_vhost_fqdn }}"
enough_nginx_fqdn: "weblate.{{ domain }}"
- role: certificate
vars:
certificate_fqdn: "{{ weblate_vhost_fqdn }}"
certificate_fqdn: "weblate.{{ domain }}"
certificate_installer: nginx
- role: monitor_http_vhost

Loading…
Cancel
Save