- name:"'local_tz: {{ local_tz }}' was set by ansible_date_time.tz in /opt/iiab/iiab/vars/default_vars.yml -- e.g. if Ansible finds symlink /etc/localtime -> ../usr/share/zoneinfo/America/New_York -- it will simplify that to 'EDT' (in the summer) or 'EST' (in the winter)"
command:echo
- name:"Create symlink /etc/localtime if it doesn't exist, by running 'timedatectl set-timezone UTC' -- THIS ALL MIGHT NO LONGER BE NEC IN 2021, AS ANSIBLE CORRECTLY NOW INTERPRETS THE ABSENCE OF /etc/localtime AS 'UTC' -- PER https://www.freedesktop.org/software/systemd/man/localtime.html"
command:timedatectl set-timezone UTC
args:
creates:/etc/localtime
- name:Symlink /etc/localtime points to which TZ?
shell:readlink /etc/localtime | awk -F "zoneinfo/" '{print $2}' # Overall shell command always completes (return code 0) even when /etc/localtime is missing -- due to the '|' pipe
register:etc_localtime
- name:"/etc/localtime now specifies: {{ etc_localtime.stdout }}"
command: echo # 'meta:noop' is not enough to force var instantiation above
#- name: Check for a /etc/localtime symlink to TZ - NEVER FAILS DUE TO PIPE