2021-09-22 15:05:43 +02:00
|
|
|
---
|
|
|
|
- name: Install apt transport https
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- apt-transport-https
|
|
|
|
state: latest
|
|
|
|
update_cache: true
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
|
|
|
|
- name: Add Graphana Repo Key
|
|
|
|
apt_key:
|
|
|
|
url: https://packages.grafana.com/gpg.key
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Add Grafana Repository
|
|
|
|
apt_repository:
|
|
|
|
repo: deb https://packages.grafana.com/oss/deb stable main
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Install Grafana
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- grafana
|
|
|
|
state: latest
|
|
|
|
update_cache: true
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
|
2021-09-22 16:23:22 +02:00
|
|
|
- name: Configure Grafana
|
|
|
|
template:
|
|
|
|
src: grafana.ini
|
|
|
|
dest: /etc/grafana/grafana.ini
|
|
|
|
owner: grafana
|
|
|
|
group: grafana
|
|
|
|
mode: u=rw,g=r,o=
|
|
|
|
no_log: true
|
|
|
|
notify: Restart Grafana
|
|
|
|
|
2021-09-22 15:05:43 +02:00
|
|
|
- name: Enable Grafana
|
|
|
|
systemd:
|
|
|
|
name: grafana-server
|
|
|
|
enabled: true
|
|
|
|
state: started
|