Restore dockerized grafana setup
It's stil on a separate machine, but in docker to allow more applications to be run easier and tied together.
This commit is contained in:
17
ansible/roles/forrest/tasks/grafana.yml
Normal file
17
ansible/roles/forrest/tasks/grafana.yml
Normal file
@ -0,0 +1,17 @@
|
||||
- name: Create install directory
|
||||
file:
|
||||
path: /opt/grafana
|
||||
state: directory
|
||||
owner: "{{ docker_user.name }}"
|
||||
mode: "{{ docker_compose_directory_mask }}"
|
||||
become: true
|
||||
|
||||
- name: Install compose file
|
||||
template:
|
||||
src: files/docker-compose.yml
|
||||
dest: /opt/grafana/docker-compose.yml
|
||||
mode: "{{ docker_compose_file_mask }}"
|
||||
owner: "{{ docker_user.name }}"
|
||||
validate: docker-compose -f %s config
|
||||
notify: restart grafana
|
||||
become: true
|
@ -1,65 +1,2 @@
|
||||
- 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:
|
||||
name: grafana-server
|
||||
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:
|
||||
- {section: http, option: bind-address, value: 0.0.0.0:8086}
|
||||
- {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}
|
||||
- name: Grafana
|
||||
include: grafana.yml
|
||||
|
Reference in New Issue
Block a user