2021-01-31 16:52:24 +00:00
|
|
|
- name: Add grafana repository
|
|
|
|
apt_repository:
|
|
|
|
repo: deb https://packages.grafana.com/oss/deb stable main
|
|
|
|
state: present
|
|
|
|
filename: grafana
|
|
|
|
|
|
|
|
- name: Add influxdb repository
|
|
|
|
apt_repository:
|
|
|
|
repo: deb https://repos.influxdata.com/debian buster stable
|
|
|
|
state: present
|
|
|
|
filename: influxdb
|
|
|
|
|
|
|
|
- name: Install grafana
|
|
|
|
package:
|
|
|
|
name: grafana
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Install influxdb
|
|
|
|
package:
|
|
|
|
name: grafana
|
|
|
|
become: true
|
|
|
|
loop:
|
|
|
|
- influxdb
|
|
|
|
- chronograf
|
|
|
|
|
|
|
|
- name: Enable grafana
|
|
|
|
service:
|
2021-01-31 17:27:44 +00:00
|
|
|
name: grafana-server
|
2021-01-31 16:52:24 +00:00
|
|
|
enabled: true
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Enable influxdb
|
|
|
|
service:
|
|
|
|
name: influxdb
|
|
|
|
enabled: true
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Configure influxdb
|
|
|
|
ini_file:
|
|
|
|
path: /etc/influxdb/influxdb.conf
|
|
|
|
mode: "0644"
|
|
|
|
section: "{{ item.section }}"
|
|
|
|
option: "{{ item.option }}"
|
|
|
|
value: "{{ item.value }}"
|
|
|
|
become: true
|
|
|
|
notify: restart influxdb
|
|
|
|
loop_control:
|
|
|
|
label: "{{ item.section }}.{{ item.option }}={{ item.value }}"
|
|
|
|
loop:
|
2021-01-31 17:27:44 +00:00
|
|
|
- {section: http, option: bind-address, value: 0.0.0.0:8086}
|
2021-01-31 16:52:24 +00:00
|
|
|
- {section: http, option: auth-enabled, value: "true"}
|
|
|
|
|
|
|
|
- name: Configure grafana
|
|
|
|
ini_file:
|
|
|
|
path: /etc/grafana/grafana.ini
|
|
|
|
mode: "0644"
|
|
|
|
section: "{{ item.section }}"
|
|
|
|
option: "{{ item.option }}"
|
|
|
|
value: "{{ item.value }}"
|
|
|
|
become: true
|
|
|
|
notify: restart grafana
|
|
|
|
loop_control:
|
|
|
|
label: "{{ item.section }}.{{ item.option }}={{ item.value }}"
|
|
|
|
loop:
|
|
|
|
- {section: server, option: domain, value: grafana.jakehoward.tech}
|