configpolicy/roles/grafana/tasks/main.yml

59 lines
1.1 KiB
YAML

- name: ensure grafana is installed
package:
name: grafana
state: present
tags:
- install
- name: ensure grafana configuration directory exists
file:
path: /etc/grafana
mode: u=rwx,go=rx
owner: root
group: root
state: directory
- 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
- name: ensure grafana starts at boot
service:
name: grafana-server
enabled: true
tags:
- service
- meta: flush_handlers
- name: ensure grafana is running
service:
name: grafana-server
state: started
tags:
- service