Bootstrap grafana role
This commit is contained in:
commit
a06dd2ec0b
11 changed files with 1263 additions and 0 deletions
40
tasks/main.yml
Normal file
40
tasks/main.yml
Normal file
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
|
||||
# https://grafana.com/docs/installation/debian/
|
||||
|
||||
- name: Install some required pkg
|
||||
apt:
|
||||
name: [ 'software-properties-common', 'apt-transport-https' ]
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Add Grafana apt key
|
||||
apt_key:
|
||||
url: https://packages.grafana.com/gpg.key
|
||||
state: present
|
||||
|
||||
- name: Add Grafana repo to apt
|
||||
apt_repository:
|
||||
repo: "{{ grafana.repo }}"
|
||||
state: present
|
||||
filename: grafana
|
||||
|
||||
- name: Install grafana
|
||||
apt:
|
||||
name: grafana
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Push Grafana config
|
||||
template:
|
||||
src: grafana.ini.j2
|
||||
dest: /etc/grafana/grafana.ini
|
||||
notify: reload grafana
|
||||
register: conf
|
||||
|
||||
- name: Enable and restart Grafana
|
||||
systemd:
|
||||
name: grafana-server
|
||||
state: restarted
|
||||
enabled: yes
|
||||
when: conf.changed
|
Loading…
Add table
Add a link
Reference in a new issue