Skip to content

Commit

Permalink
fix: fix grafana permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
gianklug committed Sep 23, 2024
1 parent ad59ea9 commit e26c2ca
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions tasks/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,20 +261,19 @@
ansible.builtin.template:
src: templates/etc/grafana/grafana.ini.j2
dest: /etc/grafana/grafana.ini
owner: root
owner: grafana
group: grafana
mode: "0660"
seuser: system_u
serole: object_r
selevel: s0
notify: Icinga2_web restart grafana-server
when: icinga2_web_grafana.enabled

- name: Make sure grafana dashboard folder exists
ansible.builtin.file:
path: /var/lib/grafana/dashboards
mode: '0644'
mode: '0660'
state: directory
owner: grafana
group: grafana
when:
- icinga2_web_grafana.enabled
- icinga2_web_grafana_dashboards | length != 0
Expand All @@ -284,7 +283,9 @@
ansible.builtin.get_url:
url: "{{ item }}"
dest: "/var/lib/grafana/dashboards/{{ item | hash('sha256') }}.json"
mode: '0644'
mode: '0660'
owner: grafana
group: grafana
loop: "{{ icinga2_web_grafana_dashboards }}"
when:
- icinga2_web_grafana.enabled
Expand All @@ -294,7 +295,9 @@
ansible.builtin.template:
src: etc/grafana/provisioning/dashboards/dashboards.yaml.j2
dest: /etc/grafana/provisioning/dashboards/dashboards.yaml
mode: '0644'
mode: '0660'
owner: grafana
group: grafana
notify: Icinga2_web restart grafana-server
when:
- icinga2_web_grafana.enabled
Expand All @@ -304,7 +307,9 @@
ansible.builtin.template:
src: etc/grafana/provisioning/datasources/datasources.yaml.j2
dest: /etc/grafana/provisioning/datasources/datasources.yaml
mode: '0644'
mode: '0660'
owner: grafana
group: grafana
notify: Icinga2_web restart grafana-server
when:
- icinga2_web_grafana.enabled
Expand Down

0 comments on commit e26c2ca

Please sign in to comment.