Compare commits
2 Commits
c512dc2b0c
...
d5ec01ecba
Author | SHA1 | Date | |
---|---|---|---|
d5ec01ecba | |||
2fc6ae1073 |
@ -8,6 +8,8 @@ grafana_service_state: started
|
|||||||
grafana_service_enabled: true
|
grafana_service_enabled: true
|
||||||
|
|
||||||
grafana_etc_path: /etc/grafana
|
grafana_etc_path: /etc/grafana
|
||||||
|
grafana_var_path: /var/lib/grafana
|
||||||
|
grafana_dashboard_path: "{{ grafana_var_path }}/dashboards"
|
||||||
grafana_config_path: "{{ grafana_etc_path }}/grafana.ini"
|
grafana_config_path: "{{ grafana_etc_path }}/grafana.ini"
|
||||||
grafana_provisioning_path: /etc/grafana/provisioning
|
grafana_provisioning_path: /etc/grafana/provisioning
|
||||||
|
|
||||||
@ -28,11 +30,11 @@ grafana_ssl_certificate: "/etc/letsencrypt/live/{{ grafana_domain }}/fullchain.p
|
|||||||
grafana_ssl_certificate_key: "/etc/letsencrypt/live/{{ grafana_domain }}/privkey.pem"
|
grafana_ssl_certificate_key: "/etc/letsencrypt/live/{{ grafana_domain }}/privkey.pem"
|
||||||
# grafana_ssl_dhparam: "/etc/letsencrypt/ssl-dhparams.pem"
|
# grafana_ssl_dhparam: "/etc/letsencrypt/ssl-dhparams.pem"
|
||||||
|
|
||||||
|
|
||||||
|
grafana_user_dashboard_path: files/grafana/dashboards/
|
||||||
|
|
||||||
grafana_datasources:
|
grafana_datasources:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
grafana_dashboards:
|
grafana_dashboards:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
grafana_dashboard_files:
|
|
||||||
[]
|
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
- name: provision datasources
|
- name: provision datasources
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: "{{ grafana_provisioning_path }}/datasources/datasource.yaml"
|
dest: "{{ grafana_provisioning_path }}/datasources/ansible.yaml"
|
||||||
content: "{{ grafana_datasources | to_nice_yaml }}"
|
content: "{{ grafana_datasources | to_nice_yaml }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ grafana_group }}"
|
group: "{{ grafana_group }}"
|
||||||
@ -72,7 +72,7 @@
|
|||||||
|
|
||||||
- name: provision dashboards
|
- name: provision dashboards
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: "{{ grafana_provisioning_path }}/dashboards/dashboards.yaml"
|
dest: "{{ grafana_provisioning_path }}/dashboards/ansible.yaml"
|
||||||
content: "{{ grafana_dashboards | to_nice_yaml }}"
|
content: "{{ grafana_dashboards | to_nice_yaml }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ grafana_group }}"
|
group: "{{ grafana_group }}"
|
||||||
@ -80,13 +80,12 @@
|
|||||||
notify: restart grafana
|
notify: restart grafana
|
||||||
|
|
||||||
- name: upload user dashboards
|
- name: upload user dashboards
|
||||||
ansible.builtin.copy:
|
ansible.posix.synchronize:
|
||||||
src: "files/grafana/dashboards/{{ item }}"
|
src: "{{ grafana_user_dashboard_path }}"
|
||||||
dest: "/var/lib/grafana/dashboards/{{ item | basename }}"
|
dest: "{{ grafana_dashboard_path }}/"
|
||||||
owner: "{{ grafana_user }}"
|
owner: false
|
||||||
group: "{{ grafana_group }}"
|
group: false
|
||||||
mode: 0644
|
delete: true
|
||||||
loop: "{{ grafana_dashboard_files | default([]) }}"
|
|
||||||
notify: restart grafana
|
notify: restart grafana
|
||||||
|
|
||||||
- name: manage service
|
- name: manage service
|
||||||
|
Loading…
Reference in New Issue
Block a user