facts: migrate bare ansible_* facts to ansible_facts[]

ansible-core deprecates injecting top-level facts as variables
(INJECT_FACTS_AS_VARS) and will stop doing so in 2.24. Convert all
remaining bare fact references (ansible_default_ipv4/ipv6, os_family,
distribution_release, date_time, ...) to the ansible_facts[] form.

Also fixes a typo (ansbile_date_time) in the postfix backup task.
This commit is contained in:
rene committed 2026-10-22 18:22:34 +02:00
1 parent 52f2ac45e5
commit 31a6a3e3d7
11 files changed
+19 -19

No files matched your search

@@ -24,7 +24,7 @@
state: absent
purge: true # Also removes configuration files
register: deb_packages_removed
when: ansible_os_family == "Debian"
when: ansible_facts['os_family'] == "Debian"
- name: system setup | package hardening | remove unnecessary packages (RedHat family)
tags: packages,hardening,system
@@ -41,7 +41,7 @@
- sudo
state: absent
register: rh_packages_removed
when: ansible_os_family == "RedHat"
when: ansible_facts['os_family'] == "RedHat"
- name: Set fact if packages were removed
set_fact: