# platform = multi_platform_sle
- name: Check 'UTC' timezone is set
  ansible.builtin.shell: |
    set -o pipefail
    timedatectl status | grep -i 'Time zone'| grep -iv 'UTC\|GMT' || true
  register: check_tz
  failed_when: "check_tz.rc not in [ 0 , 1 ]"
  changed_when: false
  check_mode: false

- name: Configure OS to use 'UTC' timezone
  ansible.builtin.command: timedatectl set-timezone UTC
  become: yes
  when: check_tz.rc == 0
