Add check so only installs if not installed.

This commit is contained in:
Hyperling 2021-03-16 20:01:55 -05:00
parent c429b38b66
commit 01de6dda1e

View File

@ -1,10 +1,18 @@
--- ---
# Application that populates InfluxDB with metric data. # Application that populates InfluxDB with metric data.
- name: Server | InfluxDB | Check
shell: which influxd
register: influxdb_check
ignore_errors: yes
- name: Server | InfluxDB | Install - name: Server | InfluxDB | Install
shell: "{{ item }}" shell: "{{ item }}"
args: args:
chdir: "{{ ansible_env.HOME }}/Downloads/" chdir: "{{ ansible_env.HOME }}/Downloads/"
loop: loop:
- mv influxdb2-2.0.4-amd64.deb ~/TRASH/ 2>/dev/null
- wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.4-amd64.deb - wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.4-amd64.deb
- dpkg -i influxdb2-2.0.4-amd64.deb - dpkg -i influxdb2-2.0.4-amd64.deb
- service influxdb start
when: influxdb_check.failed