Split Influx 1 and 2 setup. 1 works with grafana very easily. 2 must not be implemented well yet.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
---
|
||||
# Application that populates InfluxDB with metric data.
|
||||
# InfluxDB 1.* to be used with Grafana.
|
||||
|
||||
- name: Server | InfluxDB | Check
|
||||
shell: which influxd
|
||||
@ -11,10 +11,16 @@
|
||||
args:
|
||||
chdir: "{{ ansible_env.HOME }}/Downloads/"
|
||||
loop:
|
||||
- mv influxdb2-2.0.4-amd64.deb ~/TRASH/ 2>/dev/null; exit 0
|
||||
- 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
|
||||
- influx setup -f -u ling -p initpassword -o Hyperling -b main -r 0
|
||||
when: influxdb_check.failed
|
||||
- sleep 10
|
||||
when: influxdb_check.failed
|
||||
|
||||
- name: Server | InfluxDB | Config
|
||||
shell: "{{ item }}"
|
||||
loop:
|
||||
- influx -execute "create database main"
|
||||
- influx -execute "show databases"
|
||||
- influx -database main -execute "INSERT cpu,host=success,region=test value=1.00"
|
24
tasks/server/influxdb2.yml
Normal file
24
tasks/server/influxdb2.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
# Create an Influx2.0 DB. Have not successfully used in Grafana yet.
|
||||
|
||||
- name: Server | InfluxDB | Check
|
||||
shell: which influxd
|
||||
register: influxdb_check
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Server | InfluxDB | Install
|
||||
shell: "{{ item }}"
|
||||
args:
|
||||
chdir: "{{ ansible_env.HOME }}/Downloads/"
|
||||
loop:
|
||||
- mv influxdb2-2.0.4-amd64.deb ~/TRASH/ 2>/dev/null; exit 0
|
||||
- wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.4-amd64.deb
|
||||
- sudo dpkg -i influxdb2-2.0.4-amd64.deb
|
||||
- service influxdb start
|
||||
- sleep 10
|
||||
when: influxdb_check.failed
|
||||
|
||||
- name: Server | InfluxDB | Config
|
||||
shell: "{{ item }}"
|
||||
loop:
|
||||
- influx setup -f -u ling -p initpassword -o Hyperling -b main -r 0
|
Reference in New Issue
Block a user