redesign of telegraf installation

This commit is contained in:
2025-11-27 14:24:50 +01:00
parent b52de4e326
commit e216ba4122

View File

@@ -3,20 +3,33 @@
# path: "/etc/apt/sources.list.d/influxdata.list"
# state: absent
# curl --silent --location -O https://repos.influxdata.com/influxdata-archive.key
# gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 \
# | grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' \
# && cat influxdata-archive.key \
# | gpg --dearmor \
# | sudo tee /etc/apt/keyrings/influxdata-archive.gpg > /dev/null \
# && echo 'deb [signed-by=/etc/apt/keyrings/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' \
# | sudo tee /etc/apt/sources.list.d/influxdata.list
# sudo apt-get update && sudo apt-get install telegraf
- name: server | telegraf | download key
ansible.builtin.uri:
url: "https://repos.influxdata.com/influxdata-archive_compat.key"
url: "https://repos.influxdata.com/influxdata-archive.key"
dest: "/tmp/influxdb.key"
creates: "/tmp/influxdb.key"
- name: server | telegraf | verify and import key
ansible.builtin.shell:
cmd: "echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c /tmp/influxdb.key' | sha256sum -c && cat /tmp/influxdb.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null"
creates: "/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg"
cmd: "gpg --show-keys --with-fingerprint --with-colons /tmp/influxdata-archive.key 2>&1 | grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' && cat /tmp/influxdata-archive.key | gpg --dearmor | tee /etc/apt/keyrings/influxdata-archive.gpg > /dev/null"
creates: "/etc/apt/trusted.gpg.d/influxdata-archive.gpg"
- name: server | telegraf | add repository
ansible.builtin.shell:
cmd: "echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list"
cmd: "echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' | tee /etc/apt/sources.list.d/influxdata.list"
creates: "/etc/apt/sources.list.d/influxdata.list"
- name: server | telegraf | install telegraf