I have added a timezone task and maybe its buggy or maybe my logic is not quiet right. It is referring to Easter timezone instead of Daylight Timezone, yaml block below:
- name: Set timezone to ‘A.U.S. Eastern Standard Time’ (GMT+10:00) win_timezone: timezone: E. Australia Standard Time
Now, in Melbourne, we have Daylight time zone but still, it’s pointing to Easter timezone. How to ensure that timezone is automatically detected? like Eastern or Daylight by OS? Surely Microsoft must be providing timezone data with base Windows Server 2016 I suppose?
I changed to Daylight Timezone and now getting errors as below:
FAILED! => {“changed”: false, “msg”: “The specified timezone: E. Australia Daylight Time isn’t supported on the machine.”, “previous_timezone”: “E. Australia Standard Time”, “timezone”: “E. Australia Daylight Time”}
Yaml block:
name: Set timezone to ‘A.U.S. Eastern Daylight Time’ (GMT+11:00)
win_timezone:
timezone: E. Australia Daylight Time
My question, do I have to keep on changing yaml code every time when timezone changes from Eastern time to Daylight time?
The error message you are receiving is saying ‘E. Australia Daylight Time’ is not valid timezone. You cna run ‘tzutil.exe /l’ to list all the available timezones. The easiest way to do this is to set your timezone manually and run ‘tzutil.exe /g’. I did this for you and the result for UTC+10 Canberra, Melbourne, Sydney is ‘AUS Eastern Standard Time’. So just change your task to
`
name: Set timezone to A.U.S. Eastern Time (DST)
win_timezone:
timezone: AUS Eastern Standard Time
`
DST is automatically adjusted for this timezone, if you wish to always have DST off but still set to Canberra, Melbourne, Sydney set timezone to ‘AUS Eastern Standard Time_dstoff’.