roles/grafana: Deploy Grafana
This commit introduces the *grafana* role and the corresponding `grafana.yml` playbook. The role installs Grafana using the system package manager, and configures the server (including LDAP authentication).
This commit is contained in:
43
roles/grafana/tasks/main.yml
Normal file
43
roles/grafana/tasks/main.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
- name: ensure grafana is installed
|
||||
package:
|
||||
name: grafana
|
||||
state: present
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: ensure grafana is configured
|
||||
template:
|
||||
src: grafana.ini.j2
|
||||
dest: /etc/grafana/grafana.ini
|
||||
owner: root
|
||||
group: grafana
|
||||
mode: '0640'
|
||||
notify: restart grafana
|
||||
tags:
|
||||
- config
|
||||
- name: ensure grafana ldap servers are configured
|
||||
template:
|
||||
src: ldap.toml.j2
|
||||
dest: /etc/grafana/ldap.toml
|
||||
owner: root
|
||||
group: grafana
|
||||
mode: '0640'
|
||||
notify: restart grafana
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: ensure nginx is configured to proxy for grafana
|
||||
copy:
|
||||
src: grafana.nginx.conf
|
||||
dest: /etc/nginx/default.d/grafan.conf
|
||||
mode: '0644'
|
||||
notify: reload nginx
|
||||
tags:
|
||||
- nginx-config
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
- name: ensure grafana is running
|
||||
service:
|
||||
name: grafana-server
|
||||
state: started
|
||||
Reference in New Issue
Block a user