aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/grafana/templates/grafana.json.j2
blob: a9d6445bf0dae54afbd93bd93286ac5b9a88ff7f (plain)
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
{
    "command": "/usr/sbin/grafana-server --config=/etc/grafana/grafana.ini",
    "config_files": [
        {
            "source": "{{ container_config_directory }}/grafana.ini",
            "dest": "/etc/grafana/grafana.ini",
            "owner": "grafana",
            "perm": "0600"
        },
{% if check_extra_conf_grafana is defined %}
{%     for extra_conf in check_extra_conf_grafana.files | map(attribute='path') | map('basename') %}
        {
            "source": "{{ container_config_directory }}/{{ extra_conf }}",
{%         if extra_conf == 'grafana_home_dashboard.json' %}
            "dest": "/usr/share/grafana/public/dashboards/home.json",
            "owner": "root",
            "perm": "0644"
{%         else %}
            "dest": "/etc/grafana/{{ extra_conf }}",
            "owner": "grafana",
            "perm": "0600"
{%         endif %}
        },
{%     endfor %}
{% endif %}
        {
            "source": "{{ container_config_directory }}/prometheus.yaml",
            "dest": "/etc/grafana/provisioning/datasources/prometheus.yaml",
            "owner": "root",
            "perm": "0644",
            "optional": true
        },
        {
            "source": "{{ container_config_directory }}/provisioning.yaml",
            "dest": "/etc/grafana/provisioning/dashboards/provisioning.yaml",
            "owner": "root",
            "perm": "0644"
        },
        {
            "source": "{{ container_config_directory }}/dashboards/",
            "dest": "/var/lib/grafana/dashboards",
            "owner": "grafana",
            "perm": "0755",
            "optional": true
        }{% if grafana_ldap_enabled | bool %},
        {
            "source": "{{ container_config_directory }}/ldap.toml",
            "dest": "/etc/grafana/ldap.toml",
            "owner": "grafana",
            "perm": "0600"
        }{% endif %}
        {% if kolla_copy_ca_into_containers | bool %},
        {
            "source": "{{ container_config_directory }}/ca-certificates",
            "dest": "/var/lib/kolla/share/ca-certificates",
            "owner": "root",
            "perm": "0600"
        }{% endif %}
    ],
    "permissions": [
        {
            "path": "/var/lib/grafana",
            "owner": "grafana:grafana",
            "recurse": true
        },
        {
            "path": "/var/log/kolla/grafana",
            "owner": "grafana:grafana",
            "recurse": true
        }
    ]
}