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 state: started
enabled: true enabled: true
- name: Ensure tzdata package - name: Configure NTP timezone
package: when: ntp_timezone != ""
name: block:
- tzdata - name: Ensure tzdata package
state: present package:
when: name:
- ntp_timezone - tzdata
- not is_fedora_coreos state: present
- ansible_facts['os_family'] not in ["Flatcar", "Flatcar Container Linux by Kinvolk"] when:
- not is_fedora_coreos
- ansible_facts['os_family'] not in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- name: Gather selinux facts - name: Gather selinux facts
ansible.builtin.setup: ansible.builtin.setup:
gather_subset: selinux gather_subset: selinux
when: when:
- ntp_timezone - ansible_facts['os_family'] == "RedHat"
- ansible_facts['os_family'] == "RedHat"
- name: Put SELinux in permissive mode, logging actions that would be blocked. - name: Put SELinux in permissive mode, logging actions that would be blocked.
ansible.posix.selinux: ansible.posix.selinux:
policy: targeted policy: targeted
state: permissive state: permissive
when: when:
- ntp_timezone - ansible_facts['os_family'] == "RedHat"
- ansible_facts['os_family'] == "RedHat" - ansible_facts.selinux.status == 'enabled'
- ansible_facts.selinux.status == 'enabled' - ansible_facts.selinux.mode == 'enforcing'
- ansible_facts.selinux.mode == 'enforcing'
- name: Set ntp_timezone - name: Set ntp_timezone
community.general.timezone: community.general.timezone:
name: "{{ ntp_timezone }}" name: "{{ ntp_timezone }}"
when:
- ntp_timezone
- name: Re-enable SELinux - name: Re-enable SELinux
ansible.posix.selinux: ansible.posix.selinux:
policy: targeted policy: targeted
state: "{{ preinstall_selinux_state }}" state: "{{ preinstall_selinux_state }}"
when: when:
- ntp_timezone - ansible_facts['os_family'] == "RedHat"
- ansible_facts['os_family'] == "RedHat" - ansible_facts.selinux.status == 'enabled'
- ansible_facts.selinux.status == 'enabled'