community.windows.win_timezone (2.2.0) — module

Sets Windows machine timezone

Authors: Phil Schwartz (@schwartzmx)

Install collection

Install with ansible-galaxy collection install community.windows:==2.2.0


Add to requirements.yml

  collections:
    - name: community.windows
      version: 2.2.0

Description

Sets machine time to the specified timezone.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set timezone to 'Romance Standard Time' (GMT+01:00)
  community.windows.win_timezone:
    timezone: Romance Standard Time
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set timezone to 'GMT Standard Time' (GMT)
  community.windows.win_timezone:
    timezone: GMT Standard Time
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set timezone to 'Central Standard Time' (GMT-06:00)
  community.windows.win_timezone:
    timezone: Central Standard Time
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set timezime to Pacific Standard time and disable Daylight Saving time adjustments
  community.windows.win_timezone:
    timezone: Pacific Standard Time_dstoff

Inputs

    
timezone:
    description:
    - Timezone to set to.
    - 'Example: Central Standard Time'
    - To disable Daylight Saving time, add the suffix C(_dstoff) on timezones that support
      this.
    required: true
    type: str

Outputs

previous_timezone:
  description: The previous timezone if it was changed, otherwise the existing timezone.
  returned: success
  sample: Central Standard Time
  type: str
timezone:
  description: The current timezone (possibly changed).
  returned: success
  sample: Central Standard Time
  type: str

See also