fix/ansible-core 2.19: ntp_timezone implicit string -> bool (#13469)

This commit is contained in:
Max Gautier
2026-09-05 04:46:22 +00:00
committed by GitHub
parent e164ca4315
commit 490253f6f0
@@ -64,44 +64,41 @@
state: started
enabled: true
- name: Ensure tzdata package
package:
name:
- tzdata
state: present
when:
- ntp_timezone
- not is_fedora_coreos
- ansible_facts['os_family'] not in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- name: Configure NTP timezone
when: ntp_timezone != ""
block:
- name: Ensure tzdata package
package:
name:
- tzdata
state: present
when:
- not is_fedora_coreos
- 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_facts['os_family'] == "RedHat"
- name: Gather selinux facts
ansible.builtin.setup:
gather_subset: selinux
when:
- ansible_facts['os_family'] == "RedHat"
- name: Put SELinux in permissive mode, logging actions that would be blocked.
ansible.posix.selinux:
policy: targeted
state: permissive
when:
- ntp_timezone
- ansible_facts['os_family'] == "RedHat"
- ansible_facts.selinux.status == 'enabled'
- ansible_facts.selinux.mode == 'enforcing'
- name: Put SELinux in permissive mode, logging actions that would be blocked.
ansible.posix.selinux:
policy: targeted
state: permissive
when:
- ansible_facts['os_family'] == "RedHat"
- ansible_facts.selinux.status == 'enabled'
- ansible_facts.selinux.mode == 'enforcing'
- name: Set ntp_timezone
community.general.timezone:
name: "{{ ntp_timezone }}"
when:
- ntp_timezone
- name: Set ntp_timezone
community.general.timezone:
name: "{{ ntp_timezone }}"
- name: Re-enable SELinux
ansible.posix.selinux:
policy: targeted
state: "{{ preinstall_selinux_state }}"
when:
- ntp_timezone
- ansible_facts['os_family'] == "RedHat"
- ansible_facts.selinux.status == 'enabled'
- name: Re-enable SELinux
ansible.posix.selinux:
policy: targeted
state: "{{ preinstall_selinux_state }}"
when:
- ansible_facts['os_family'] == "RedHat"
- ansible_facts.selinux.status == 'enabled'