switched to new facts-syntax

This commit is contained in:
2026-01-12 12:31:24 +01:00
parent 037b998219
commit 9fd07d57a4
41 changed files with 111 additions and 109 deletions

View File

@@ -51,12 +51,12 @@
ansible.builtin.lineinfile:
path: /etc/telegraf/telegraf.conf
regexp: '^\s*#?\s*hostname\s*='
line: ' hostname = "{{ ansible_fqdn }}"'
line: ' hostname = "{{ ansible_facts['fqdn'] }}"'
owner: root
group: root
mode: '0644'
notify: restart_telegraf
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
- name: Configure telegraf agent interval
tags: telegraf
@@ -68,7 +68,7 @@
group: root
mode: '0644'
notify: restart_telegraf
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
- name: Configure telegraf agent flush_interval
tags: telegraf
@@ -80,7 +80,7 @@
group: root
mode: '0644'
notify: restart_telegraf
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
- name: Configure telegraf agent flush_jitter
tags: telegraf
@@ -92,7 +92,7 @@
group: root
mode: '0644'
notify: restart_telegraf
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
- name: Configure telegraf agent collection_jitter
tags: telegraf
@@ -104,7 +104,7 @@
group: root
mode: '0644'
notify: restart_telegraf
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
- name: Configure telegraf agent metric_batch_size
tags: telegraf
@@ -116,7 +116,7 @@
group: root
mode: '0644'
notify: restart_telegraf
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
- name: Configure telegraf agent metric_buffer_limit
tags: telegraf
@@ -128,7 +128,7 @@
group: root
mode: '0644'
notify: restart_telegraf
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
- name: Configure telegraf agent round_interval
tags: telegraf
@@ -140,7 +140,7 @@
group: root
mode: '0644'
notify: restart_telegraf
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
- name: server | telegraf | create systemd override directory for telegraf
ansible.builtin.file: