aboutsummaryrefslogblamecommitdiffstats
path: root/roles/grafana/tasks/main.yml
blob: 7c1a19cac9806f60a91318815853cf5b8d5b9d2c (plain) (tree)






































                                                           
- name: install grafana
  package:
    name: grafana
    state: present

- name: create grafana directory
  file:
    path: "{{ grafana_dir }}/{{ item }}"
    owner: "{{ grafana_user }}"
    group: "{{ grafana_group }}"
    mode: 0640
    state: directory
  loop:
    - ""
    - data
    - logs
    - plugins

- name: generate grafana configuration
  template:
    src: grafana.ini.j2
    dest: "{{ grafana_configuration_file }}"
    owner: 0
    group: 0
    mode: 0644

- name: generate grafana data sources
  template:
    src: datasources-default.yml.j2
    dest: /etc/grafana/provisioning/datasources/default.yml
    owner: "{{ grafana_user }}"
    group: "{{ grafana_group }}"
    mode: 0640

- name: start and enable grafana service
  service:
    name: grafana
    state: restarted
    enabled: true
remember that computers suck.