timezone - Configure timezone setting

New in version 2.2.


  • This module configures the timezone setting, both of the system clock and of the hardware clock. If you want to set up the NTP, use service module.
  • It is recommended to restart crond after changing the timezone, otherwise the jobs may run at the wrong time.
  • Several different tools are used depending on the OS/Distribution involved. For Linux it can use timedatectl or edit /etc/sysconfig/clock or /etc/timezone and``hwclock``. On SmartOS , sm-set-timezone, for BSD, /etc/localtime is modified.
  • As of version 2.3 support was added for SmartOS and BSDs.
  • Windows, AIX and HPUX are not supported, please let us know if you find any other OS/distro in which this fails.


parameter required default choices comments
Whether the hardware clock is in UTC or in local timezone. Default is to keep current setting. Note that this option is recommended not to change and may fail to configure, especially on virtual environments such as AWS. At least one of name and hwclock are required. Only used on Linux.

aliases: rtc
Name of the timezone for the system clock. Default is to keep current setting. At least one of name and hwclock are required.


- name: set timezone to Asia/Tokyo
    name: Asia/Tokyo

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
diff The differences about the given arguments. success dictionary
name description returned type sample
after The values after change dict
before The values before change dict



  • On SmartOS the sm-set-timezone utility (part of the smtools package) is required to set the zone timezone


This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.


This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.