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,5 +1,8 @@
|
||||||
---
|
---
|
||||||
- name: "Webserver | Aktiviere Apache-Modul"
|
- name: "Webserver | Configure Apache2"
|
||||||
|
when: grafana_webserver == "apache"
|
||||||
|
block:
|
||||||
|
- name: "Webserver | Aktiviere Apache-Modul"
|
||||||
community.general.apache2_module:
|
community.general.apache2_module:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -8,13 +11,13 @@
|
||||||
- proxy
|
- proxy
|
||||||
- proxy_http
|
- 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"
|
||||||
|
|
Loading…
Reference in a new issue