ansible-role-nextcloud/tasks/gateway.yml

40 lines
1.2 KiB
YAML

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