Jakub Sokołowski 99dfea5887
add grafana_plugins variable to install plugins
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-11-17 10:46:09 +01:00

51 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: prometheus.yml.j2
dest: '{{ grafana_cont_vol }}/etc/provisioning/datasources/prometheus.yml'
owner: '{{ grafana_host_uid }}'
group: docker
mode: 0640
- 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 }}'