env-ansible/tasks/server/influxdb1.yml

28 lines
871 B
YAML
Raw Normal View History

---
# 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-20 06:15:56 -05:00
- name: Server | InfluxDB1 | Check
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 }}"
args:
chdir: "{{ ansible_env.HOME }}/Downloads/"
loop:
- 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
- service influxdb start
- sleep 10
when: influxdb_check.failed
2021-03-20 06:15:56 -05:00
- name: Server | InfluxDB1 | Config
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