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
|
||||
Die folgenden Variablen müssen vor der Ausführung der Rolle gesetzt werden:
|
||||
|
||||
| Variable | Wert | Bedeutung |
|
||||
|----------|------|--------------|
|
||||
| `grafana_domain` | string | Domainname der Grafana-Instanz |
|
||||
| `grafana_db_password` | string | Passwort des Datenbanknutzers |
|
||||
| `grafana_webserver` | `apache` oder `nginx` | Optional: Einrichtung des entsprechendem Webservers |
|
||||
| Variable | Wert | Default | Bedeutung |
|
||||
|----------|------|---------|------|
|
||||
| `grafana_domain` | string | | Domainname der Grafana-Instanz |
|
||||
| `grafana_db_password` | string | |Passwort des Datenbanknutzers |
|
||||
| `grafana_webserver` | `apache` oder `nginx` | |Optional: Einrichtung des entsprechendem Webservers |
|
||||
| `grafana_db_type` | `mysql` oder `postgres` | `sqlite3` | optional: Datenbanktyp |
|
||||
|
||||
# Ausführen der Rolle
|
||||
- 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_user: grafana
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
- name: Database
|
||||
ansible.builtin.import_tasks: database.yml
|
||||
when: grafana_db_type != "sqlite3"
|
||||
delegate_to: "{{ database_host }}"
|
||||
|
||||
- name: Configuration
|
||||
|
|
|
@ -7,11 +7,13 @@ enforce_domain = true
|
|||
root_url = https://{{ grafana_domain }}
|
||||
|
||||
[database]
|
||||
type = mysql
|
||||
host = {{ database_host }}:3306
|
||||
type = {{ grafana_db_type }}
|
||||
{% if grafana_db_type != sqlite3 %}
|
||||
host = {{ database_host }}:{{ grafana_db_port }}
|
||||
name = {{ grafana_db }}
|
||||
user = {{ grafana_db_user }}
|
||||
password = {{ grafana_db_password }}
|
||||
{% endif %}
|
||||
|
||||
[session]
|
||||
cookie_secure = true
|
||||
|
|
Loading…
Reference in a new issue