Add influxdb server for metrics
This commit is contained in:
parent
ec0c78e6d9
commit
b3a72eb8f1
7 changed files with 63 additions and 3 deletions
24
ansible/roles/forrest/files/docker-compose-influxdb.yml
Normal file
24
ansible/roles/forrest/files/docker-compose-influxdb.yml
Normal file
|
@ -0,0 +1,24 @@
|
|||
version: "2.3"
|
||||
|
||||
services:
|
||||
influxdb:
|
||||
image: influxdb:1.8-alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /mnt/tank/dbs/influx/forrest:/var/lib/influxdb
|
||||
environment:
|
||||
- INFLUXDB_HTTP_AUTH_ENABLED=true
|
||||
ports:
|
||||
- 8086:8086
|
||||
|
||||
chronograf:
|
||||
image: chronograf:1.8-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- INFLUXDB_URL=http://influxdb:8086
|
||||
- INFLUXDB_USERNAME=influxadmin
|
||||
- INFLUXDB_PASSWORD={{ influxdb_admin_password }}
|
||||
volumes:
|
||||
- ./chronograf:/var/lib/chronograf
|
||||
ports:
|
||||
- 8888:8888
|
|
@ -2,3 +2,8 @@
|
|||
shell:
|
||||
chdir: /opt/grafana
|
||||
cmd: "{{ docker_update_command }}"
|
||||
|
||||
- name: restart influxdb
|
||||
shell:
|
||||
chdir: /opt/influxdb
|
||||
cmd: "{{ docker_update_command }}"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- name: Create install directory
|
||||
- name: Create grafana install directory
|
||||
file:
|
||||
path: /opt/grafana
|
||||
state: directory
|
||||
|
@ -6,9 +6,9 @@
|
|||
mode: "{{ docker_compose_directory_mask }}"
|
||||
become: true
|
||||
|
||||
- name: Install compose file
|
||||
- name: Install grafana compose file
|
||||
template:
|
||||
src: files/docker-compose.yml
|
||||
src: files/docker-compose-grafana.yml
|
||||
dest: /opt/grafana/docker-compose.yml
|
||||
mode: "{{ docker_compose_file_mask }}"
|
||||
owner: "{{ docker_user.name }}"
|
||||
|
|
17
ansible/roles/forrest/tasks/influxdb.yml
Normal file
17
ansible/roles/forrest/tasks/influxdb.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
- name: Create influxdb install directory
|
||||
file:
|
||||
path: /opt/influxdb
|
||||
state: directory
|
||||
owner: "{{ docker_user.name }}"
|
||||
mode: "{{ docker_compose_directory_mask }}"
|
||||
become: true
|
||||
|
||||
- name: Install influxdb compose file
|
||||
template:
|
||||
src: files/docker-compose-influxdb.yml
|
||||
dest: /opt/influxdb/docker-compose.yml
|
||||
mode: "{{ docker_compose_file_mask }}"
|
||||
owner: "{{ docker_user.name }}"
|
||||
validate: docker-compose -f %s config
|
||||
notify: restart influxdb
|
||||
become: true
|
|
@ -1,2 +1,5 @@
|
|||
- name: Grafana
|
||||
include: grafana.yml
|
||||
|
||||
- name: InfluxDB
|
||||
include: influxdb.yml
|
||||
|
|
|
@ -19,3 +19,14 @@ grafana_from_email: !vault |
|
|||
65626435353036663938356330303564346137363961313236636263333238313166656231353931
|
||||
6161633634636337320a396661373963623661363162643161393033653032623432323536306630
|
||||
39346665653031316261346636336566343563373165653763643831313234356532
|
||||
influxdb_admin_password: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
31323766353638383736373034323334656630613637393036353038303061393232613438643534
|
||||
6430636662313565313836363465303836366562653838340a393932613361633735393737376133
|
||||
62313538363731386237653965376661383031613733616437303434623563626233346636323731
|
||||
3861363965373432630a333963623830666139316166336239623262663361393231326335303434
|
||||
62363931383533626234343235613563336233633137636232323836643432383666336331663135
|
||||
63666331636630663038333439663365386666303033346636333263363262643436643965636636
|
||||
63373030313932383332313637643233366133366361653531643037366434656364626234353066
|
||||
31623363626666353434646666636334346233613035663361316439643963316465393266653633
|
||||
31626330646634353636626139396534613631316361316664353435336132396538
|
||||
|
|
Loading…
Reference in a new issue