feat(auth): integrate Grafana and Ntfy with Authentik SSO
ansible-core-mon / deploy (push) Successful in 24s
ansible-core-net / deploy (push) Successful in 39s
ansible-core-secrets / deploy (push) Successful in 12s
ansible-opnsense / deploy (push) Successful in 3s
ansible-rus-central / deploy (push) Successful in 36s
ansible-core-mon / deploy (push) Successful in 24s
ansible-core-net / deploy (push) Successful in 39s
ansible-core-secrets / deploy (push) Successful in 12s
ansible-opnsense / deploy (push) Successful in 3s
ansible-rus-central / deploy (push) Successful in 36s
This commit is contained in:
1 parent
3670bb6033
commit
811d65526b
9 files changed
+174
-6
No files matched your search
@@ -5,6 +5,7 @@ prometheus_retention: "30d"
|
||||
grafana_admin_user: "{{ lookup('ansible.builtin.env', 'GRAFANA_ADMIN_USER', default='admin') }}"
|
||||
grafana_admin_password: "{{ lookup('ansible.builtin.env', 'GRAFANA_ADMIN_PASSWORD', default='') }}"
|
||||
grafana_root_url: "https://graf.gunihome.ru"
|
||||
grafana_oauth_client_secret: "{{ lookup('ansible.builtin.env', 'GRAFANA_OAUTH_CLIENT_SECRET', default='') }}"
|
||||
|
||||
ntfy_base_url: "https://ntfy.gunihome.ru"
|
||||
ntfy_default_topic: "homelab-alerts"
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
---
|
||||
- name: Проверить наличие секрета Grafana OAuth
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- grafana_oauth_client_secret is defined and grafana_oauth_client_secret | length > 0
|
||||
fail_msg: "Секрет GRAFANA_OAUTH_CLIENT_SECRET не передан!"
|
||||
|
||||
- name: Создать базовые каталоги мониторинга
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
|
||||
@@ -57,6 +57,17 @@ services:
|
||||
- GF_SECURITY_ADMIN_PASSWORD={{ grafana_admin_password }}
|
||||
- GF_USERS_ALLOW_SIGN_UP=false
|
||||
- GF_SERVER_ROOT_URL={{ grafana_root_url }}
|
||||
- GF_AUTH_GENERIC_OAUTH_ENABLED=true
|
||||
- GF_AUTH_GENERIC_OAUTH_NAME=Authentik
|
||||
- GF_AUTH_GENERIC_OAUTH_CLIENT_ID=grafana
|
||||
- GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET={{ grafana_oauth_client_secret }}
|
||||
- GF_AUTH_GENERIC_OAUTH_SCOPES=openid email profile
|
||||
- GF_AUTH_GENERIC_OAUTH_AUTH_URL=https://auth.gunihome.ru/application/o/authorize/
|
||||
- GF_AUTH_GENERIC_OAUTH_TOKEN_URL=https://auth.gunihome.ru/application/o/token/
|
||||
- GF_AUTH_GENERIC_OAUTH_API_URL=https://auth.gunihome.ru/application/o/userinfo/
|
||||
- GF_AUTH_GENERIC_OAUTH_ALLOW_SIGN_UP=true
|
||||
- "GF_AUTH_GENERIC_OAUTH_ROLE_ATTRIBUTE_PATH=contains(groups[*], 'admins') && 'Admin' || 'Viewer'"
|
||||
- GF_AUTH_GENERIC_OAUTH_ALLOW_ASSIGN_GRAFANA_ADMIN=true
|
||||
volumes:
|
||||
- ./grafana_data:/var/lib/grafana
|
||||
- ./grafana/provisioning:/etc/grafana/provisioning:ro
|
||||
|
||||
Reference in new issue
Block a user