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

@@ -13,8 +13,8 @@
loop:
- { regex: "^root=.*$", line: "root=rene@tantooine.myfirewall.org"}
- { regex: "^mailhub=.*", line: "mailhub=mail.universe.local"}
- { regex: "^hostname=.*", line: "hostname={{ ansible_fqdn }}"}
when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"]
- { regex: "^hostname=.*", line: "hostname={{ ansible_facts['fqdn'] }}"}
when: ansible_facts['distribution'] in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"]
- name: server | utilities | remove postfix
package:
name:

View File

@@ -13,7 +13,7 @@
group: "root"
mode: "0660"
validate: "{{ commands.visudo }} -cf %s"
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
- name: server | snmpd | create /etc/snmp
ansible.builtin.file:

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: