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