WIP: Depend webserver tasks on specific webserver
This commit is contained in:
parent
c892e8fba8
commit
e0d2378808
2 changed files with 22 additions and 18 deletions
|
@ -10,6 +10,7 @@ Die folgenden Variablen müssen vor der Ausführung der Rolle gesetzt werden:
|
|||
|----------|------|--------------|
|
||||
| `grafana_domain` | string | Domainname der Grafana-Instanz |
|
||||
| `grafana_db_password` | string | Passwort des Datenbanknutzers |
|
||||
| `grafana_webserver` | `apache` oder `nginx` | Optional: Einrichtung des entsprechendem Webservers |
|
||||
|
||||
# Ausführen der Rolle
|
||||
- Erstelle ein Playbook namen `grafana.yml` und führe die Rolle aus:
|
||||
|
|
|
@ -1,21 +1,24 @@
|
|||
---
|
||||
- name: "Webserver | Aktiviere Apache-Modul"
|
||||
community.general.apache2_module:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
notify: restart apache2
|
||||
loop:
|
||||
- proxy
|
||||
- proxy_http
|
||||
- name: "Webserver | Configure Apache2"
|
||||
when: grafana_webserver == "apache"
|
||||
block:
|
||||
- name: "Webserver | Aktiviere Apache-Modul"
|
||||
community.general.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 | 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
|
||||
- name: "Webserver | Aktiviere Grafana-Seitenkonfiguration"
|
||||
ansible.builtin.command:
|
||||
cmd: "a2ensite {{ grafana_domain }}"
|
||||
creates: "/etc/apache2/site-enabled/{{ grafana_domain }}.conf"
|
||||
notify: reload apache2
|
||||
|
|
Loading…
Reference in a new issue