Use ansible_facts.xxx instead of ansible_xxx. (#1237)

This commit is contained in:
Felix Fontein
2026-02-07 16:00:22 +01:00
committed by GitHub
parent 14be59e7e4
commit 85a3c811cb
65 changed files with 95 additions and 95 deletions
@@ -12,20 +12,20 @@
pkg_mgr: community.general.pkgng
ansible_pkg_mgr: community.general.pkgng
cacheable: true
when: ansible_os_family == "FreeBSD"
when: ansible_facts.os_family == "FreeBSD"
- ansible.builtin.set_fact:
pkg_mgr: community.general.zypper
ansible_pkg_mgr: community.general.zypper
cacheable: true
when: ansible_os_family == "Suse"
when: ansible_facts.os_family == "Suse"
- ansible.builtin.shell:
# noqa: command-instead-of-module
cmd: |
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/*.repo
sed -i 's%#baseurl=http://mirror.centos.org/%baseurl=https://vault.centos.org/%g' /etc/yum.repos.d/*.repo
when: ansible_distribution in 'CentOS' and ansible_distribution_major_version == '7'
when: ansible_facts.distribution in 'CentOS' and ansible_facts.distribution_major_version == '7'
- ansible.builtin.shell:
# noqa: command-instead-of-module
@@ -33,4 +33,4 @@
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*.repo
sed -i 's%#baseurl=http://mirror.centos.org/$contentdir/$releasever/%baseurl=https://vault.centos.org/8.4.2105/%g' /etc/yum.repos.d/CentOS-Linux-*.repo
ignore_errors: true # This fails for CentOS Stream 8
when: ansible_distribution in 'CentOS' and ansible_distribution_major_version == '8'
when: ansible_facts.distribution in 'CentOS' and ansible_facts.distribution_major_version == '8'