From df87ea4c95bb2f5a8aba06c117292dfef37ea661 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 6 Mar 2026 16:16:06 +0100 Subject: Replace deprecated `ansible_$foo` with `ansible_facts[$foo]`. --- templates/etc/apt/sources.list.d/debian.sources.j2 | 4 ++-- templates/etc/postfix/main.cf.j2 | 4 ++-- templates/etc/systemd/network/01-wired.network.j2 | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'templates/etc') diff --git a/templates/etc/apt/sources.list.d/debian.sources.j2 b/templates/etc/apt/sources.list.d/debian.sources.j2 index 3894b72..c859a4e 100644 --- a/templates/etc/apt/sources.list.d/debian.sources.j2 +++ b/templates/etc/apt/sources.list.d/debian.sources.j2 @@ -1,11 +1,11 @@ Types: deb URIs: https://deb.debian.org/debian -Suites: {{ ansible_lsb.codename }} {{ ansible_lsb.codename }}-updates +Suites: {{ ansible_facts.lsb.codename }} {{ ansible_facts.lsb.codename }}-updates Components: main non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.pgp Types: deb URIs: https://deb.debian.org/debian-security -Suites: {{ ansible_lsb.codename }}-security +Suites: {{ ansible_facts.lsb.codename }}-security Components: main non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.pgp diff --git a/templates/etc/postfix/main.cf.j2 b/templates/etc/postfix/main.cf.j2 index 35a6790..10313b4 100644 --- a/templates/etc/postfix/main.cf.j2 +++ b/templates/etc/postfix/main.cf.j2 @@ -9,8 +9,8 @@ compatibility_level = 3.6 smtputf8_enable = no myorigin = /etc/mailname -myhostname = {{ ansible_fqdn }} -mydomain = {{ ansible_domain }} +myhostname = {{ ansible_facts.fqdn }} +mydomain = {{ ansible_facts.domain }} append_dot_mydomain = no # This server is for internal use only diff --git a/templates/etc/systemd/network/01-wired.network.j2 b/templates/etc/systemd/network/01-wired.network.j2 index 7be5d21..dc85b2e 100644 --- a/templates/etc/systemd/network/01-wired.network.j2 +++ b/templates/etc/systemd/network/01-wired.network.j2 @@ -1,13 +1,13 @@ [Match] -Name={{ ansible_default_ipv4.interface }} +Name={{ ansible_facts.default_ipv4.interface }} [Network] DHCP=yes -{% if ansible_default_ipv6.get('scope', '') == 'global' %} +{% if ansible_facts.default_ipv6.get('scope', '') == 'global' %} [Address] -Address={{ ansible_default_ipv6.address }}/{{ ansible_default_ipv6.prefix }} +Address={{ ansible_facts.default_ipv6.address }}/{{ ansible_facts.default_ipv6.prefix }} [Route] -Gateway={{ ansible_default_ipv6.gateway }} +Gateway={{ ansible_facts.default_ipv6.gateway }} {%- endif %} -- cgit v1.2.3