This repository has been archived by the owner on May 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
/
Copy pathgrafana.ini.j2
166 lines (147 loc) · 3.78 KB
/
grafana.ini.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# {{ ansible_managed }}
# More informations:
# http://docs.grafana.org/installation/configuration
# https://github.com/grafana/grafana/blob/master/conf/sample.ini
app_mode = production
instance_name = {{ grafana_instance }}
# Directories
[paths]
data = {{ grafana_data_dir }}
logs = {{ grafana_logs_dir }}
plugins = {{ grafana_data_dir }}/plugins
; datasources = conf/datasources
# HTTP options
[server]
http_addr = {{ grafana_address }}
http_port = {{ grafana_port }}
domain = {{ grafana_domain }}
root_url = {{ grafana_url }}
{% for k,v in grafana_server.iteritems() %}
{% if not k in ['http_addr', 'http_port', 'domain', 'root_url'] %}
{{ k }} = {{ v }}
{% endif %}
{% endfor %}
# Database
[database]
{% for k,v in grafana_database.iteritems() %}
{% if k == 'password' %}
{{ k }} = """{{ v }}""""
{% else %}
{{ k }} = {{ v }}
{% endif %}
{% endfor %}
# Security
[security]
{% for k,v in grafana_security.iteritems() %}
{{ k }} = {{ v }}
{% endfor %}
# Users management and registration
{% if grafana_users != {} %}
[users]
{% for k,v in grafana_users.iteritems() %}
{{ k }} = {{ v }}
{% endfor %}
{% endif %}
[emails]
welcome_email_on_sign_up = {{ grafana_welcome_email_on_sign_up }}
# Authentication
{% if grafana_auth != {} %}
[auth]
disable_login_form = {{ grafana_auth.disable_login_form | default('False') }}
disable_signout_menu = {{ grafana_auth.disable_signout_menu | default('False') }}
{% for section, options in grafana_auth.iteritems() %}
{% if section in ['disable_login_form', 'disable_signout_menu'] %}
{% elif section == 'basic' %}
[auth.basic]
enabled = True
{% else %}
[auth.{{ section }}]
enabled = True
{% for k, v in options.iteritems() %}
{% if k != 'enabled' %}{{ k }} = {{ v }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
# Session
{% if grafana_session != {} %}
[session]
{% for k,v in grafana_session.iteritems() %}
{{ k }} = {{ v }}
{% endfor %}
{% endif %}
# Analytics
[analytics]
reporting_enabled = "{{ grafana_analytics.reporting_enabled | default(True) }}"
{% if grafana_analytics.google_analytics_ua_id is defined and grafana_analytics.google_analytics_ua_id != '' %}
google_analytics_ua_id = "{{ grafana_analytics.google_analytics_ua_id }}"
{% endif %}
# Dashboards
[dashboards]
versions_to_keep = 20
[dashboards.json]
enabled = true
path = {{ grafana_data_dir }}/dashboards
# Alerting
{% if grafana_alerting %}
[alerting]
enabled = True
;execute_alerts = true
{% endif %}
# SMTP and email config
{% if grafana_smtp != {} %}
[smtp]
enabled = True
{% for k,v in grafana_smtp.iteritems() %}
{% if k == 'enabled' %}{% endif %}
{% if k == 'password' %}
{{ k }} = """{{ v }}""""
{% else %}
{{ k }} = {{ v }}
{% endif %}
{% endfor %}
{% endif %}
# Logging
[log]
mode = console file
level = info
# Metrics
{% if grafana_metrics != {} %}
[metrics]
enabled = true
interval_seconds = {{ grafana_metrics.interval_seconds | default(10) }}
{% if grafana_metrics.graphite is defined %}
[metrics.graphite]
address = {{ grafana_metrics.graphite.address }}
prefix = {{ grafana_metrics.graphite.prefix }}
{% endif %}
{% endif %}
# Tracing
{% if grafana_tracing != {} %}
[tracing.jaeger]
{% for k,v in grafana_tracing.iteritems() %}
{{ k }} = {{ v }}
{% endfor %}
{% endif %}
# Grafana.com configuration
[grafana_com]
url = https://grafana.com
# Snapshots
{% if grafana_snapshots != {} %}
[snapshots]
{% for k,v in grafana_snapshots.iteritems() %}
{{ k }} = {{ v }}
{% endfor %}
{% endif %}
# External image storage
{% if grafana_image_storage != {} %}
[external_image_storage]
provider = {{ grafana_image_storage.provider }}
[external_image_storage.{{ grafana_image_storage.provider }}]
{% for k,v in grafana_image_storage.iteritems() %}
{% if k != 'provider' %}
{{ k }} = {{ v }}
{% endif %}
{% endfor %}
{% endif %}