2020-03-08 16:41:55 +01:00
|
|
|
---
|
|
|
|
|
# Server/Telegraf: Install and Setup Telegraf Monitoring - Debian Version
|
|
|
|
|
|
2023-04-28 23:25:21 +02:00
|
|
|
- name: Telegraf - Install apt-transport-https
|
|
|
|
|
become: true
|
2021-08-28 16:50:37 +02:00
|
|
|
ansible.builtin.apt:
|
2020-03-08 16:41:55 +01:00
|
|
|
name: apt-transport-https
|
|
|
|
|
state: present
|
2023-04-28 23:25:21 +02:00
|
|
|
diff: false
|
|
|
|
|
- name: Telegraf - Add telegraf repo key
|
|
|
|
|
become: true
|
2021-08-28 16:50:37 +02:00
|
|
|
ansible.builtin.apt_key:
|
2023-03-11 18:37:29 +01:00
|
|
|
url: https://repos.influxdata.com/influxdata-archive_compat.key
|
2020-03-08 16:41:55 +01:00
|
|
|
state: present
|
2023-04-28 23:25:21 +02:00
|
|
|
- name: Telegraf - Add telegraf repo
|
|
|
|
|
become: true
|
2025-12-20 21:08:31 +01:00
|
|
|
when: ansible_facts['distribution_release'] != 'bookworm'
|
2021-08-28 16:50:37 +02:00
|
|
|
ansible.builtin.apt_repository:
|
2025-12-20 21:08:31 +01:00
|
|
|
repo: "deb https://repos.influxdata.com/debian {{ ansible_facts['distribution_release'] }} stable"
|
2020-03-08 16:41:55 +01:00
|
|
|
state: present
|
2024-01-20 19:51:51 +01:00
|
|
|
- name: Telegraf - Add telegraf repo
|
2025-12-20 21:08:31 +01:00
|
|
|
when: ansible_facts['distribution_release'] == 'bookworm'
|
2024-01-20 19:51:51 +01:00
|
|
|
become: true
|
|
|
|
|
ansible.builtin.apt_repository:
|
|
|
|
|
repo: "deb https://repos.influxdata.com/debian bullseye stable"
|
|
|
|
|
state: present
|
2023-04-28 23:25:21 +02:00
|
|
|
- name: Telegraf - Install telegraf
|
|
|
|
|
become: true
|
2021-08-28 16:50:37 +02:00
|
|
|
ansible.builtin.apt:
|
2020-03-08 16:41:55 +01:00
|
|
|
name: telegraf
|
|
|
|
|
state: latest
|
2023-04-28 23:25:21 +02:00
|
|
|
update_cache: true
|
2020-03-08 16:41:55 +01:00
|
|
|
cache_valid_time: 3600
|
2023-04-28 23:25:21 +02:00
|
|
|
diff: false
|
2020-05-22 13:18:45 +02:00
|
|
|
|
|
|
|
|
# Install SNMP utilities for telegraf monitoring
|
2023-04-28 23:25:21 +02:00
|
|
|
- name: Telegraf - Install SNMP utilities
|
2022-02-13 20:52:02 +01:00
|
|
|
when: telegraf_ubnt_ns_ips is defined
|
2023-04-28 23:25:21 +02:00
|
|
|
become: true
|
2021-08-28 16:50:37 +02:00
|
|
|
ansible.builtin.apt:
|
2020-05-22 13:18:45 +02:00
|
|
|
name: "{{ packages }}"
|
|
|
|
|
state: present
|
|
|
|
|
vars:
|
|
|
|
|
packages:
|
|
|
|
|
- snmp
|
|
|
|
|
- snmp-mibs-downloader
|
2023-04-28 23:25:21 +02:00
|
|
|
diff: false
|