---
- name: Dependencies installed
  community.general.pkgng:
    name: grafana7,redis
    state: latest

- name: Grafana enabled
  shell: sysrc grafana_enable="YES"

- name: Grafana config installed
  template:
    src: grafana.conf.j2
    dest: /usr/local/etc/grafana.conf
    mode: 0644

- name: Grafana started
  service: name=grafana state=started
