switched to new facts-syntax
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
---
|
||||
# Load distro specific variables
|
||||
- include_vars: "{{ ansible_distribution | lower }}.yml"
|
||||
- include_vars: "{{ ansible_facts['distribution'] | lower }}.yml"
|
||||
tags: always
|
||||
ignore_errors: True
|
||||
- include_vars: "{{ ansible_fqdn | lower }}.yml"
|
||||
- include_vars: "{{ ansible_facts['fqdn'] | lower }}.yml"
|
||||
ignore_errors: True
|
||||
|
||||
- block:
|
||||
- include_tasks: utilities/mail_transfer_agent.yml
|
||||
- include_tasks: utilities/telegraf.yml
|
||||
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
|
||||
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
|
||||
- include_tasks: utilities/netdata.yml
|
||||
when: netdata is defined and netdata == true
|
||||
- include_tasks: utilities/snmpd.yml
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
package:
|
||||
name: "cronie"
|
||||
state: latest
|
||||
when: ansible_distribution == "Archlinux"
|
||||
when: ansible_facts['distribution'] == "Archlinux"
|
||||
|
||||
- name: server | system_setup | cron (VM)
|
||||
tags: cron
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user