feat: added telegraf role to setup telegraf
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
parent
26d7236f0b
commit
20fd717e0b
38
roles/telegraf/tasks/main.yaml
Normal file
38
roles/telegraf/tasks/main.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
- name: Install required system packages
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- gnupg
|
||||
- curl
|
||||
state: latest
|
||||
update_cache: true
|
||||
|
||||
- name: Add Influxdata GPG apt key
|
||||
ansible.builtin.apt_key:
|
||||
url: "https://repos.influxdata.com/influxdata-archive.key"
|
||||
state: present
|
||||
|
||||
- name: Add Influxdata repository
|
||||
ansible.builtin.apt_repository:
|
||||
repo: deb https://repos.influxdata.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable
|
||||
state: present
|
||||
filename: "telegraf"
|
||||
|
||||
- name: Install telegraf package
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- telegraf
|
||||
state: latest
|
||||
update_cache: true
|
||||
|
||||
- name: Enable telegraf service
|
||||
ansible.builtin.service:
|
||||
name: telegraf
|
||||
enabled: true
|
||||
|
||||
- name: Stop telegraf service (configure it before starting)
|
||||
ansible.builtin.service:
|
||||
name: telegraf
|
||||
state: stopped
|
5
telegraf.yaml
Normal file
5
telegraf.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: "Install telegraf on debian."
|
||||
hosts: telegraf
|
||||
roles:
|
||||
- telegraf
|
Loading…
Reference in New Issue
Block a user