mirror of
https://github.com/status-im/infra-role-grafana.git
synced 2025-02-16 14:36:34 +00:00
54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
---
|
|
- name: Create grafana directories
|
|
file:
|
|
path: '{{ grafana_cont_vol }}'
|
|
state: directory
|
|
owner: 'dockremap'
|
|
group: 'docker'
|
|
mode: 0775
|
|
recurse: true
|
|
|
|
- name: Create grafana directories
|
|
file:
|
|
path: '{{ item }}'
|
|
state: directory
|
|
owner: '{{ grafana_host_uid }}'
|
|
group: docker
|
|
mode: 0775
|
|
recurse: true
|
|
with_items:
|
|
- '{{ grafana_cont_vol }}/etc'
|
|
- '{{ grafana_cont_vol }}/etc/provisioning/datasources'
|
|
- '{{ grafana_cont_vol }}/lib'
|
|
- '{{ grafana_cont_vol }}/lib/plugins'
|
|
- '{{ grafana_cont_vol }}/lib/dashboards'
|
|
|
|
- name: Generate main config file
|
|
template:
|
|
src: 'grafana.ini.j2'
|
|
dest: '{{ grafana_cont_vol }}/etc/grafana.ini'
|
|
owner: '{{ grafana_host_uid }}'
|
|
group: docker
|
|
mode: 0640
|
|
register: grafana_config
|
|
|
|
- name: Generate datasource config file
|
|
template:
|
|
src: '{{ item }}.j2'
|
|
dest: '{{ grafana_cont_vol }}/etc/provisioning/datasources/{{ item }}'
|
|
owner: '{{ grafana_host_uid }}'
|
|
group: docker
|
|
mode: 0640
|
|
with_items:
|
|
- prometheus.yml
|
|
- postgres.yml
|
|
|
|
- name: Install plugins from ZIP archives
|
|
unarchive:
|
|
src: '{{ item }}'
|
|
dest: '{{ grafana_cont_vol }}/lib/plugins'
|
|
owner: '{{ grafana_host_uid }}'
|
|
group: docker
|
|
remote_src: true
|
|
with_items: '{{ grafana_unsigned_plugins }}'
|