{
    "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
        }
    ],
    "permissions": [
        {
            "path": "/var/lib/grafana",
            "owner": "grafana:grafana",
            "recurse": true
        },
        {
            "path": "/var/log/kolla/grafana",
            "owner": "grafana:grafana",
            "recurse": true
        }
    ]
}
