ansible-role-nextcloud/tasks/gateway.yml

36 lines
1.1 KiB
YAML

---
- name: "gateway: {{ instance.domain }}: Domain zur Zertifikatsliste hinzufügen"
lineinfile:
path: /etc/dehydrated/domains.txt
insertafter: "^# nextcloud"
line: "{{ instance.domain }}"
delegate_to: "{{ gateway_host }}"
- name: "gateway: {{ instance.domain }}: Alias zur Zertifikatsliste hinzufügen"
lineinfile:
path: /etc/dehydrated/domains.txt
insertafter: "^# nextcloud"
line: "{{ instance.alias }}"
when: instance.alias is defined
delegate_to: "{{ gateway_host }}"
- name: "gateway: {{ instance.domain }}: Zertifikat erstellen"
command: dehydrated --cron -g
delegate_to: "{{ gateway_host }}"
- name: "gateway: {{ instance.domain }}: Proxy einrichten"
template:
src: nginx_site.j2
dest: "/etc/nginx/sites-available/{{ instance.domain }}"
owner: root
group: root
mode: 0644
delegate_to: "{{ gateway_host }}"
- name: "gateway: {{ instance.domain }}: Seite aktivieren"
file:
src: "/etc/nginx/sites-available/{{ instance.domain }}"
dest: "/etc/nginx/sites-enabled/{{ instance.domain }}"
state: link
notify: reload nginx
delegate_to: "{{ gateway_host }}"