ansible-role-nextcloud/tasks/gateway.yml

41 lines
1.2 KiB
YAML
Raw Normal View History

2020-12-03 15:52:14 +01:00
---
- name: "gateway: {{ instance.domain }}: Domain zur Zertifikatsliste hinzufügen"
2020-12-03 15:52:14 +01:00
lineinfile:
path: /etc/dehydrated/domains.txt
insertafter: "^# nextcloud"
line: "{{ instance.domain }}"
register: dehydrated
2021-06-26 02:32:29 +02:00
delegate_to: "{{ gateway_host }}"
- name: "gateway: {{ instance.domain }}: Alias zur Zertifikatsliste hinzufügen"
lineinfile:
path: /etc/dehydrated/domains.txt
insertafter: "^# nextcloud"
2021-10-14 16:09:47 +02:00
line: "{{ item }}"
2021-06-26 02:32:29 +02:00
when: instance.alias is defined
register: dehydrated
delegate_to: "{{ gateway_host }}"
2021-10-14 16:09:47 +02:00
loop: "{{ instance.alias }}"
2020-12-03 15:52:14 +01:00
- name: "gateway: {{ instance.domain }}: Zertifikat erstellen"
2020-12-03 15:52:14 +01:00
command: dehydrated --cron -g
delegate_to: "{{ gateway_host }}"
when: dehydrated.changed
2020-12-03 15:52:14 +01:00
- name: "gateway: {{ instance.domain }}: Proxy einrichten"
2020-12-03 15:52:14 +01:00
template:
src: nginx_site.j2
dest: "/etc/nginx/sites-available/{{ instance.domain }}"
2020-12-03 15:52:14 +01:00
owner: root
group: root
mode: 0644
delegate_to: "{{ gateway_host }}"
2020-12-03 15:52:14 +01:00
- name: "gateway: {{ instance.domain }}: Seite aktivieren"
2020-12-03 15:52:14 +01:00
file:
src: "/etc/nginx/sites-available/{{ instance.domain }}"
dest: "/etc/nginx/sites-enabled/{{ instance.domain }}"
2020-12-03 15:52:14 +01:00
state: link
notify: reload nginx
delegate_to: "{{ gateway_host }}"