2021-03-16 19:41:10 -05:00
|
|
|
---
|
2021-03-20 05:03:19 -05:00
|
|
|
# InfluxDB 1.* to be used with Grafana.
|
2021-03-20 06:12:04 -05:00
|
|
|
# https://docs.influxdata.com/influxdb/v1.8/introduction/get-started/
|
2021-03-16 19:41:10 -05:00
|
|
|
|
2021-03-20 06:15:56 -05:00
|
|
|
- name: Server | InfluxDB1 | Check
|
2021-03-16 20:01:55 -05:00
|
|
|
shell: which influxd
|
|
|
|
register: influxdb_check
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2021-03-20 06:15:56 -05:00
|
|
|
- name: Server | InfluxDB1 | Install
|
2021-03-16 19:54:36 -05:00
|
|
|
shell: "{{ item }}"
|
2021-03-16 19:41:10 -05:00
|
|
|
args:
|
|
|
|
chdir: "{{ ansible_env.HOME }}/Downloads/"
|
|
|
|
loop:
|
2021-03-20 04:39:13 -05:00
|
|
|
- mv influxdb_1.8.4_amd64.deb ~/TRASH/ 2>/dev/null; exit 0
|
|
|
|
- wget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.4_amd64.deb
|
|
|
|
- sudo dpkg -i influxdb_1.8.4_amd64.deb
|
2021-03-16 20:01:55 -05:00
|
|
|
- service influxdb start
|
2021-03-20 05:03:19 -05:00
|
|
|
- sleep 10
|
|
|
|
when: influxdb_check.failed
|
|
|
|
|
2021-03-20 06:15:56 -05:00
|
|
|
- name: Server | InfluxDB1 | Config
|
2021-03-20 05:03:19 -05:00
|
|
|
shell: "{{ item }}"
|
|
|
|
loop:
|
|
|
|
- influx -execute "create database main"
|
|
|
|
- influx -execute "show databases"
|
2021-03-20 06:12:04 -05:00
|
|
|
- influx -database main -execute "INSERT cpu,host=success,region=test value=1.00"
|
|
|
|
when: influxdb_check.failed
|