Merge pull request 'feat: add playbook for grafana configuration' (!110) from feat/configure-grafana into master

Reviewed-on: https://gitea.n39.eu/Netz39_Admin/netz39-infra-ansible/pulls/110
Reviewed-by: Stefan Haun <tux@netz39.de>
This commit is contained in:
dkdent 2022-11-12 15:48:50 +01:00
commit 0ebeff9225
6 changed files with 48 additions and 13 deletions

17
configure-grafana.yml Normal file
View file

@ -0,0 +1,17 @@
---
- name: Configure Grafana
hosts: localhost
tasks:
- name: Create netz39 user
community.grafana.grafana_user:
url: "https://{{ hostvars['pottwal.n39.eu']['grafana_domain_name'] }}"
url_username: admin
url_password: >
"{{ hostvars['pottwal.n39.eu']['grafana_admin_password'] }}"
name: "{{ item.name }}"
email: "{{ item.email }}"
login: "{{ item.login }}"
password: "{{ item.password }}"
is_admin: true
state: present
loop: "{{ grafana_users }}"

View file

@ -22,7 +22,7 @@
- conference.jabber.n39.eu - conference.jabber.n39.eu
deploy_cert_hook: "docker exec prosody prosodyctl --root cert import ${DOMAIN} /var/lib/dehydrated/certs" deploy_cert_hook: "docker exec prosody prosodyctl --root cert import ${DOMAIN} /var/lib/dehydrated/certs"
- name: redmine.n39.eu - name: redmine.n39.eu
- name: influx.n39.eu - name: "{{ influxdb_domain_name }}"
- name: uptime.n39.eu - name: uptime.n39.eu
- name: "{{ grafana_domain_name }}" - name: "{{ grafana_domain_name }}"
- role: penguineer.dehydrated_cron - role: penguineer.dehydrated_cron
@ -279,11 +279,11 @@
volumes: volumes:
- "{{ data_dir }}/influxdb:/var/lib/influxdb2" - "{{ data_dir }}/influxdb:/var/lib/influxdb2"
- name: Setup proxy site influx.n39.eu - name: Setup proxy site {{ influxdb_domain_name }}
include_role: include_role:
name: setup_http_site_proxy name: setup_http_site_proxy
vars: vars:
site_name: influx.n39.eu site_name: "{{ influxdb_domain_name }}"
proxy_port: "{{ influxdb_host_port }}" proxy_port: "{{ influxdb_host_port }}"
# Expected setup for the data directory # Expected setup for the data directory

View file

@ -0,0 +1,5 @@
grafana_users:
- name: Netz39
email: accounts+grafana@netz39.de
login: netz39
password: "{{ vault_grafana_user_password }}"

View file

@ -0,0 +1,7 @@
$ANSIBLE_VAULT;1.1;AES256
66303836663730383331396265363534666661326163643634306332613038653530333333326236
3163343062656262363364373561646163623666623738620a373039353861306261643435346330
64333139336536346130646435393235643838356634636233363035306437353230333864346437
6562366564373461380a393265656437303531396234613266383334373762646536643733323565
61366261303965316263303434313462656661666530636662306633663336316462303339633531
3832643731646535306562326162363864646338343165633834

View file

@ -23,6 +23,7 @@ redmine_database: redmine
redmine_database_password: "{{ vault_redmine_database_password }}" redmine_database_password: "{{ vault_redmine_database_password }}"
influxdb_host_port: 8088 influxdb_host_port: 8088
influxdb_domain_name: influx.n39.eu
influxdb_image: influxdb:2.4-alpine influxdb_image: influxdb:2.4-alpine
influxdb_init_username: admin influxdb_init_username: admin
influxdb_init_password: "{{ vault_influxdb_init_password }}" influxdb_init_password: "{{ vault_influxdb_init_password }}"

View file

@ -1,4 +1,5 @@
--- ---
roles:
- src: hifis.unattended_upgrades - src: hifis.unattended_upgrades
version: v1.12.2 version: v1.12.2
- src: git+https://github.com/adriagalin/ansible.timezone.git - src: git+https://github.com/adriagalin/ansible.timezone.git
@ -9,3 +10,7 @@
version: v1.0.0 version: v1.0.0
- src: git+https://github.com/maz3max/ble-keykeeper-role.git - src: git+https://github.com/maz3max/ble-keykeeper-role.git
version: v1.1.0 version: v1.1.0
collections:
- name: community.grafana
version: 1.5.3