mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 11:12:06 +00:00
0-init/tasks/tz.yml: Why ansible_date_time.tz is a problem
This commit is contained in:
parent
e3ef4cded0
commit
371146c4ed
1 changed files with 18 additions and 0 deletions
|
@ -1,3 +1,21 @@
|
|||
# 2022-12-30: FYI ansible_date_time.tz provides TZ ABBREVIATIONS (equivalent
|
||||
# to 'date +%Z' output) which leads to serious ambiguity -- and not just (A)
|
||||
# seasonal EST/EDT ambiguities, or (B) floods of geographic synonyms for the
|
||||
# very same time zone! More Seriously: (C) both commands above output "IST"
|
||||
# for both Israel Standard Time (+0200) AND India Standard Time (+0530). Etc!
|
||||
#
|
||||
# While Ansible provides 2 other vars that (slightly) help disambiguate
|
||||
# (ansible_date_time.tz_dst and ansible_date_time.tz_offset), there's a far
|
||||
# better way -- which is to read the System TZ directly from Linux:
|
||||
#
|
||||
# timedatectl show -p "Timezone" --value
|
||||
#
|
||||
# This takes care of essentially everything (e.g. output "America/New_York")
|
||||
# by checking (1) symlink /etc/localtime then (2) text file /etc/timezone
|
||||
# then (3) if neither exist, then "UTC" is declated (correctly!) One
|
||||
# drawback: timedatectl if not easily usable within chroot environments.
|
||||
|
||||
|
||||
- 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
|
||||
|
||||
|
|
Loading…
Reference in a new issue