Jannik Beyerstedt
a0ac0a67a7
Having the when condition of a task at the top instead of bottom is easiert to read. Also some spaces were another whitespace character on accident.
38 lines
1,000 B
YAML
38 lines
1,000 B
YAML
---
|
|
# Server/Telegraf: Install and Setup Telegraf Monitoring - Debian Version
|
|
|
|
- name: telegraf - Install apt-transport-https
|
|
become: yes
|
|
ansible.builtin.apt:
|
|
name: apt-transport-https
|
|
state: present
|
|
- name: telegraf - Add telegraf repo key
|
|
become: yes
|
|
ansible.builtin.apt_key:
|
|
url: https://repos.influxdata.com/influxdb.key
|
|
state: present
|
|
- name: telegraf - Add telegraf repo
|
|
become: yes
|
|
ansible.builtin.apt_repository:
|
|
repo: "deb https://repos.influxdata.com/debian {{ ansible_distribution_release }} stable"
|
|
state: present
|
|
- name: telegraf - Install telegraf
|
|
become: yes
|
|
ansible.builtin.apt:
|
|
name: telegraf
|
|
state: latest
|
|
update_cache: yes
|
|
cache_valid_time: 3600
|
|
|
|
# Install SNMP utilities for telegraf monitoring
|
|
- name: telegraf - Install SNMP utilities
|
|
when: telegraf_ubnt_ns_ips is defined
|
|
become: yes
|
|
ansible.builtin.apt:
|
|
name: "{{ packages }}"
|
|
state: present
|
|
vars:
|
|
packages:
|
|
- snmp
|
|
- snmp-mibs-downloader
|