Skip to content
This repository was archived by the owner on May 31, 2023. It is now read-only.

Commit bf01d6d

Browse files
boutetnicopaulfantom
authored andcommitted
Replace hardcoded paths with data dir variable (#148)
[patch]
1 parent 1bdf67b commit bf01d6d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

handlers/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- name: Set privileges on provisioned dashboards
99
become: true
1010
file:
11-
path: "/var/lib/grafana/dashboards"
11+
path: "{{ grafana_data_dir }}/dashboards"
1212
recurse: true
1313
owner: grafana
1414
group: grafana
@@ -18,7 +18,7 @@
1818
- name: Set privileges on provisioned dashboards directory
1919
become: true
2020
file:
21-
path: "/var/lib/grafana/dashboards"
21+
path: "{{ grafana_data_dir }}/dashboards"
2222
state: directory
2323
recurse: false
2424
mode: 0755

tasks/dashboards.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
folder: ''
120120
type: file
121121
options:
122-
path: /var/lib/grafana/dashboards
122+
path: "{{ grafana_data_dir }}/dashboards"
123123
backup: false
124124
owner: root
125125
group: grafana
@@ -128,7 +128,7 @@
128128

129129
- name: Register previously copied dashboards
130130
find:
131-
paths: "/var/lib/grafana/dashboards"
131+
paths: "{{ grafana_data_dir }}/dashboards"
132132
hidden: true
133133
patterns:
134134
- "*.json"
@@ -139,7 +139,7 @@
139139
become: true
140140
copy:
141141
src: "{{ item }}"
142-
dest: "/var/lib/grafana/dashboards/{{ item | basename }}"
142+
dest: "{{ grafana_data_dir }}/dashboards/{{ item | basename }}"
143143
with_fileglob:
144144
- "{{ _tmp_dashboards.path }}/*"
145145
- "{{ grafana_dashboards_dir }}/*.json"

0 commit comments

Comments
 (0)