Replace injected Ansible fact variables with ansible_facts in preinstall role (#13232)

This commit is contained in:
Nikhil Kumar
2026-05-14 16:08:30 +05:30
committed by GitHub
parent 22ce2f799f
commit 2ed677ce86
9 changed files with 41 additions and 38 deletions

View File

@@ -15,7 +15,7 @@
/etc/ntp.conf
{%- elif ntp_package == "ntpsec" -%}
/etc/ntpsec/ntp.conf
{%- elif ansible_os_family in ['RedHat', 'Suse'] -%}
{%- elif ansible_facts['os_family'] in ['RedHat', 'Suse'] -%}
/etc/chrony.conf
{%- else -%}
/etc/chrony/chrony.conf
@@ -24,7 +24,7 @@
ntp_service_name: >-
{% if ntp_package == "chrony" -%}
chronyd
{%- elif ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk", "RedHat", "Suse"] -%}
{%- elif ansible_facts['os_family'] in ["Flatcar", "Flatcar Container Linux by Kinvolk", "RedHat", "Suse"] -%}
ntpd
{%- else -%}
ntp
@@ -72,14 +72,14 @@
when:
- ntp_timezone
- not is_fedora_coreos
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- ansible_facts['os_family'] not in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- name: Gather selinux facts
ansible.builtin.setup:
gather_subset: selinux
when:
- ntp_timezone
- ansible_os_family == "RedHat"
- ansible_facts['os_family'] == "RedHat"
- name: Put SELinux in permissive mode, logging actions that would be blocked.
ansible.posix.selinux:
@@ -87,7 +87,7 @@
state: permissive
when:
- ntp_timezone
- ansible_os_family == "RedHat"
- ansible_facts['os_family'] == "RedHat"
- ansible_facts.selinux.status == 'enabled'
- ansible_facts.selinux.mode == 'enforcing'
@@ -103,5 +103,5 @@
state: "{{ preinstall_selinux_state }}"
when:
- ntp_timezone
- ansible_os_family == "RedHat"
- ansible_facts['os_family'] == "RedHat"
- ansible_facts.selinux.status == 'enabled'