Files
no-secrets-athq-ansible/roles/monitoring-influx/tasks/main.yaml

46 lines
915 B
YAML

- name: Copy influx apt keyring
copy:
src: influx-repo.gpg
dest: /usr/share/keyrings/
mode: 0644
when: monitoring_master
- name: Add influx apt repo
copy:
src: influxdb.list
dest: /etc/apt/sources.list.d/
mode: 0644
when: monitoring_master
- name: Install influxdb
apt:
name: influxdb
state: present
when: monitoring_master
- name: Influxdb master server config
template:
src: influxdb.conf.j2
dest: /etc/influxdb/influxdb.conf
when: monitoring_master
notify:
- restart influxdb
- name: Create Influx collectd-db
shell: 'echo "CREATE DATABASE collectd;" | influx'
changed_when: False
when: monitoring_master
- name: Install collectd
apt:
name: collectd
install_recommends: false
state: present
- name: Collectd config
template:
src: collectd.conf.j2
dest: /etc/collectd/collectd.conf
notify:
- restart collectd