Added role influxdb

This commit is contained in:
Darks 2020-09-10 23:19:29 +02:00
parent 0603f502e0
commit c30e6af44d
Signed by: Darks
GPG Key ID: F61F10FA138E797C
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
---
- name: "Install InfluxDB"
pacman:
name: "influxdb"
state: present
- name: "Install python-influxdb"
pacman:
name: "python-influxdb"
state: present
- name: "Create database telegraf"
influxdb_database:
hostname: "localhost"
database_name: "telegraf"
username: "telegraf"
password: "{{ lookup('passwordstore', 'PCv5/telegraf_influxdb') }}"
- name: "Create 30 days retention policy"
influxdb_retention_policy:
hostname: "localhost"
database_name: "telegraf"
policy_name: thirty_days
duration: 30d
replication: 1
- name: "Restart InfluxDB"
service:
name: "influxdb"
state: restarted