ansible-role-grafana/tasks/webserver.yml

27 lines
786 B
YAML

---
- name: "webserver | Erzeuge Letsencrypt-Zertifikat"
ansible.builtin.lineinfile:
path: /etc/dehydrated/domains.txt
line: "{{ grafana.domain }}"
notify: get certificate
- name: "webserver | Aktiviere Apache-Modul"
ansible.builtin.apache2_module:
name: "{{ item }}"
state: present
notify: restart apache2
loop:
- proxy
- proxy_http
- name: "webserver | Kopiere Grafana-Seitenkonfiguration"
ansible.builtin.template:
src: apache2-site.conf
dest: "/etc/apache2/sites-available/{{ grafana.domain }}.conf"
mode: 0644
- name: "webserver | Aktiviere Grafana-Seitenkonfiguration"
ansible.builtin.command:
cmd: "a2ensite {{ grafana.domain }}"
creates: "/etc/apache2/site-enabled/{{ grafana.domain }}.conf"
notify: reload apache2