---
# Activation des métriques Telegraf

## Instalation de Telegraf
- name: Ajout de la clé du depot Telegraf
  apt_key:
    url: https://repos.influxdata.com/influxdb.key

- name: Ajout du depot influxdata
  apt_repository:
    repo: deb https://repos.influxdata.com/debian buster stable

- name: Installation de Telegraf
  apt:
    name: telegraf

- name: Application de la conf général de Telegraf
  template:
    src: telegraf-general.conf.j2
    dest: /etc/telegraf/telegraf.conf
    mode: u=rw,g=r,o=r
  notify:
    - restart telegraf

## Instalation des metrics BBB
- name: Ajout du script python qui met en forme les metrics BBB
  copy:
    src: bbb-telegraf.py
    dest: /opt/
    mode: u=rwx,g=rx,o=rx

- name: Application de la conf BBB pour Telegraf
  copy:
    src: telegraf-input-bbb.conf
    dest: /etc/telegraf/telegraf.d/jitsi.conf
    mode: u=rw,g=r,o=r
  notify:
    - restart telegraf
