install telegraf (configuration still to be done)

This commit is contained in:
2023-01-25 12:03:44 +01:00
parent ff2a52b1d8
commit b0af0effd3
2 changed files with 22 additions and 0 deletions

View File

@@ -8,6 +8,8 @@
- block: - block:
- include_tasks: utilities/mail_transfer_agent.yml - include_tasks: utilities/mail_transfer_agent.yml
- include_tasks: utilities/telegraf.yml
when: ansible_distribution in ["Debian", "Ubuntu"]
- include_tasks: utilities/netdata.yml - include_tasks: utilities/netdata.yml
when: netdata is defined and netdata == true when: netdata is defined and netdata == true
- include_tasks: utilities/snmpd.yml - include_tasks: utilities/snmpd.yml

View File

@@ -0,0 +1,20 @@
- name: server | telegraf | download key
uri:
url: "https://repos.influxdata.com/influxdb.key"
dest: "/tmp/influxdb.key" # not required. A path of where to download the file to (if desired). If I(dest) is a directory, the basename of the file on the remote server will be used.
- name: server | telegraf | verify and import key
shell:
cmd: "echo '23a1c8836f0afc5ed24e0486339d7cc8f6790b83886c4c96995b88a061c5bb5d influxdb.key' | sha256sum -c && cat influxdb.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdb.gpg > /dev/null"
creates: "/etc/apt/trusted.gpg.d/influxdb.gpg"
- name: server | telegraf | add repository
shell:
cmd: "echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list"
creates: "/etc/apt/sources.list.d/influxdata.list"
- name: server | telegraf | install telegraf
apt:
name: "telegraf" # not required. A list of package names, like C(foo), or package specifier with version, like C(foo=1.0). Name wildcards (fnmatch) like C(apt*) and version wildcards like C(foo=1.0*) are also supported.
state: latest
update_cache: yes