Use sqlite3 as default database
This commit is contained in:
parent
e0d2378808
commit
bec76bc57d
4 changed files with 12 additions and 7 deletions
11
README.md
11
README.md
|
@ -6,11 +6,12 @@ Grafana
|
||||||
# Variablen
|
# Variablen
|
||||||
Die folgenden Variablen müssen vor der Ausführung der Rolle gesetzt werden:
|
Die folgenden Variablen müssen vor der Ausführung der Rolle gesetzt werden:
|
||||||
|
|
||||||
| Variable | Wert | Bedeutung |
|
| Variable | Wert | Default | Bedeutung |
|
||||||
|----------|------|--------------|
|
|----------|------|---------|------|
|
||||||
| `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 |
|
| `grafana_webserver` | `apache` oder `nginx` | |Optional: Einrichtung des entsprechendem Webservers |
|
||||||
|
| `grafana_db_type` | `mysql` oder `postgres` | `sqlite3` | optional: Datenbanktyp |
|
||||||
|
|
||||||
# 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,3 +1,4 @@
|
||||||
---
|
---
|
||||||
|
grafana_db_type: sqlite3
|
||||||
grafana_db: grafana
|
grafana_db: grafana
|
||||||
grafana_db_user: grafana
|
grafana_db_user: grafana
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
- name: Database
|
- name: Database
|
||||||
ansible.builtin.import_tasks: database.yml
|
ansible.builtin.import_tasks: database.yml
|
||||||
|
when: grafana_db_type != "sqlite3"
|
||||||
delegate_to: "{{ database_host }}"
|
delegate_to: "{{ database_host }}"
|
||||||
|
|
||||||
- name: Configuration
|
- name: Configuration
|
||||||
|
|
|
@ -7,11 +7,13 @@ enforce_domain = true
|
||||||
root_url = https://{{ grafana_domain }}
|
root_url = https://{{ grafana_domain }}
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
type = mysql
|
type = {{ grafana_db_type }}
|
||||||
host = {{ database_host }}:3306
|
{% if grafana_db_type != sqlite3 %}
|
||||||
|
host = {{ database_host }}:{{ grafana_db_port }}
|
||||||
name = {{ grafana_db }}
|
name = {{ grafana_db }}
|
||||||
user = {{ grafana_db_user }}
|
user = {{ grafana_db_user }}
|
||||||
password = {{ grafana_db_password }}
|
password = {{ grafana_db_password }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
[session]
|
[session]
|
||||||
cookie_secure = true
|
cookie_secure = true
|
||||||
|
|
Loading…
Reference in a new issue