mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-21 15:58:14 -02:30
Replace injected Ansible fact variables with ansible_facts in preinstall role (#13232)
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user