Skip to content

Commit 52b1925

Browse files
authored
Merge pull request #234 from stfc/update_grafana
Updates to Cloud Grafana
2 parents d16de10 + f64662e commit 52b1925

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

grafana_monitoring/roles/grafana/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,4 @@
8181
ansible.builtin.systemd_service:
8282
state: restarted
8383
name: grafana-server.service
84+
enabled: true

grafana_monitoring/roles/grafana/templates/cloud_datasource.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ datasources:
100100
type: prometheus
101101
uid: "prod-chatops"
102102
access: proxy
103-
url: https://prometheus.cloud-chatops.nubes.rl.ac.uk
103+
url: https://prometheus.chatops.nubes.rl.ac.uk
104104
isDefault: false
105105
basicAuth: true
106106
basicAuthUser: {{ prod_chatops_prometheus_username }}

grafana_monitoring/roles/grafana/templates/grafana.ini.j2

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ api_url = https://iris-iam.stfc.ac.uk/userinfo
1919
groups_attribute_path = groups[*]
2020
allowed_groups = "stfc-cloud/team,stfc-cloud/admins"
2121

22+
# Only apply role changes on dev so we can edit datasources and dashboards before pushing changes to prod.
23+
{% if inventory_hostname.startswith("dev") %}
24+
role_attribute_path=contains(groups[*], 'stfc-cloud/admins') && 'Admin' || contains(groups[*], 'stfc-cloud/team') && 'Editor' || 'Viewer'
25+
{% else %}
26+
# Keep role for all users as Viewer on production.
27+
role_attribute_path='Viewer'
28+
{% endif %}
29+
2230
[log]
2331
# Raise the log level as the default is "info"
2432
log_level = critical
2533

2634
[security]
2735
admin_password="{{ grafana_admin_password }}"
28-
29-
{% if inventory_hostname.startswith("dev") %}
30-
[users]
31-
auto_assign_org_role=Admin
32-
{% endif %}

grafana_monitoring/roles/haproxy/templates/haproxy.cfg.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ frontend {{ inventory_hostname }}
2222
default_backend localhost
2323

2424
backend localhost
25+
option forwardfor
2526
server grafana 127.0.0.1:3000 check

0 commit comments

Comments
 (0)