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_domain` | string | Domainname der Grafana-Instanz |
|
||||||
| `grafana_db_password` | string | Passwort des Datenbanknutzers |
|
| `grafana_db_password` | string | Passwort des Datenbanknutzers |
|
||||||
|
| `grafana_webserver` | `apache` oder `nginx` | Optional: Einrichtung des entsprechendem Webservers |
|
||||||
|
|
||||||
# Ausführen der Rolle
|
# Ausführen der Rolle
|
||||||
- Erstelle ein Playbook namen `grafana.yml` und führe die Rolle aus:
|
- Erstelle ein Playbook namen `grafana.yml` und führe die Rolle aus:
|
||||||
|
|
|
@ -1,21 +1,24 @@
|
||||||
---
|
---
|
||||||
- name: "Webserver | Aktiviere Apache-Modul"
|
- name: "Webserver | Configure Apache2"
|
||||||
community.general.apache2_module:
|
when: grafana_webserver == "apache"
|
||||||
name: "{{ item }}"
|
block:
|
||||||
state: present
|
- name: "Webserver | Aktiviere Apache-Modul"
|
||||||
notify: restart apache2
|
community.general.apache2_module:
|
||||||
loop:
|
name: "{{ item }}"
|
||||||
- proxy
|
state: present
|
||||||
- proxy_http
|
notify: restart apache2
|
||||||
|
loop:
|
||||||
|
- proxy
|
||||||
|
- proxy_http
|
||||||
|
|
||||||
- name: "Webserver | Kopiere Grafana-Seitenkonfiguration"
|
- name: "Webserver | Kopiere Grafana-Seitenkonfiguration"
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: apache2-site.conf
|
src: apache2-site.conf
|
||||||
dest: "/etc/apache2/sites-available/{{ grafana_domain }}.conf"
|
dest: "/etc/apache2/sites-available/{{ grafana_domain }}.conf"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
||||||
- name: "Webserver | Aktiviere Grafana-Seitenkonfiguration"
|
- name: "Webserver | Aktiviere Grafana-Seitenkonfiguration"
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: "a2ensite {{ grafana_domain }}"
|
cmd: "a2ensite {{ grafana_domain }}"
|
||||||
creates: "/etc/apache2/site-enabled/{{ grafana_domain }}.conf"
|
creates: "/etc/apache2/site-enabled/{{ grafana_domain }}.conf"
|
||||||
notify: reload apache2
|
notify: reload apache2
|
||||||
|
|
Loading…
Reference in a new issue