win_timezone - Sets Windows machine timezone
New in version 2.1.
Synopsis
- Sets machine time to the specified timezone.
Options
parameter | required | default | choices | comments |
---|---|---|---|---|
timezone | yes | Timezone to set to. Example Central Standard Time |
Examples
- name: Set timezone to 'Romance Standard Time' (GMT+01:00) win_timezone: timezone: Romance Standard Time - name: Set timezone to 'GMT Standard Time' (GMT) win_timezone: timezone: GMT Standard Time - name: Set timezone to 'Central Standard Time' (GMT-06:00) win_timezone: timezone: Central Standard Time
Return Values
Common return values are documented here Return Values, the following are the fields unique to this module:
name | description | returned | type | sample |
---|---|---|---|---|
previous_timezone | The previous timezone if it was changed, otherwise the existing timezone | success | string | Central Standard Time |
timezone | The current timezone (possibly changed) | success | string | Central Standard Time |
Notes
Note
- The module will check if the provided timezone is supported on the machine.
- A list of possible timezones is available from
tzutil.exe /l
and from https://msdn.microsoft.com/en-us/library/ms912391.aspx - If running on Server 2008 the hotfix https://support.microsoft.com/en-us/help/2556308/tzutil-command-line-tool-is-added-to-windows-vista-and-to-windows-server-2008 needs to be installed to be able to run this module.
Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/win_timezone_module.html