ansible-role-zammad/tasks/gateway.yml

30 lines
866 B
YAML
Raw Normal View History

2021-07-28 18:28:22 +02:00
---
- name: "gateway: Domain zur Zertifikatsliste hinzufügen"
lineinfile:
path: /etc/dehydrated/domains.txt
insertafter: "^### systemausfall"
line: "{{ zammad_domain }}"
when: "'dehydrated' in ansible_facts.packages"
register: add_certificate
delegate_to: "{{ gateway_host }}"
- name: "gateway: Zertifikat erstellen"
command: dehydrated --cron -g
when: add_certificate.changed
delegate_to: "{{ gateway_host }}"
- name: "gateway: Proxy einrichten"
template:
src: nginx-rp-site.j2
dest: "/etc/nginx/sites-available/{{ zammad_domain }}"
force: no
delegate_to: "{{ gateway_host }}"
- name: "gateway: Seite aktivieren"
file:
src: "/etc/nginx/sites-available/{{ zammad_domain }}"
dest: "/etc/nginx/sites-enabled/{{ zammad_domain }}"
state: link
notify: reload reverse_proxy
delegate_to: "{{ gateway_host }}"