t*: normalize docs (#9339)

* t*: normalize docs

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* break long line to regain sanity

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Alexei Znamensky 2024-12-24 23:59:56 +13:00 committed by GitHub
parent c141f86883
commit 6e84c1375e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 109 additions and 134 deletions

View file

@ -8,20 +8,18 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: timezone
short_description: Configure timezone setting
description:
- 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 M(ansible.builtin.service) module.
- 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
M(ansible.builtin.service) module.
- It is recommended to restart C(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 C(timedatectl) or edit C(/etc/sysconfig/clock) or C(/etc/timezone) and C(hwclock).
On SmartOS, C(sm-set-timezone), for macOS, C(systemsetup), for BSD, C(/etc/localtime) is modified.
On AIX, C(chtz) is used.
- Make sure that the zoneinfo files are installed with the appropriate OS package, like C(tzdata) (usually always installed,
when not using a minimal installation like Alpine Linux).
- Several different tools are used depending on the OS/Distribution involved. For Linux it can use C(timedatectl) or edit C(/etc/sysconfig/clock)
or C(/etc/timezone) and C(hwclock). On SmartOS, C(sm-set-timezone), for macOS, C(systemsetup), for BSD, C(/etc/localtime) is modified. On
AIX, C(chtz) is used.
- Make sure that the zoneinfo files are installed with the appropriate OS package, like C(tzdata) (usually always installed, when not using
a minimal installation like Alpine Linux).
- Windows and HPUX are not supported, please let us know if you find any other OS/distro in which this fails.
extends_documentation_fragment:
- community.general.attributes
@ -35,51 +33,49 @@ options:
description:
- Name of the timezone for the system clock.
- Default is to keep current setting.
- B(At least one of name and hwclock are required.)
- B(At least one) of O(name) and O(hwclock) are required.
type: str
hwclock:
description:
- 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.
- B(At least one of name and hwclock are required.)
- I(Only used on Linux.)
- Note that this option is recommended not to change and may fail to configure, especially on virtual environments such as AWS.
- B(At least one) of O(name) and O(hwclock) are required.
- I(Only used on Linux).
type: str
aliases: [ rtc ]
choices: [ local, UTC ]
aliases: [rtc]
choices: [local, UTC]
notes:
- On Ubuntu 24.04 the C(util-linux-extra) package is required to provide the C(hwclock) command.
- On SmartOS the C(sm-set-timezone) utility (part of the smtools package) is required to set the zone timezone.
- On AIX only Olson/tz database timezones are usable (POSIX is not supported).
An OS reboot is also required on AIX for the new timezone setting to take effect.
Note that AIX 6.1+ is needed (OS level 61 or newer).
- On AIX only Olson/tz database timezones are usable (POSIX is not supported). An OS reboot is also required on AIX for the new timezone setting
to take effect. Note that AIX 6.1+ is needed (OS level 61 or newer).
author:
- Shinichi TAMURA (@tmshn)
- Jasper Lievisse Adriaanse (@jasperla)
- Indrajit Raychaudhuri (@indrajitr)
'''
"""
RETURN = r'''
RETURN = r"""
diff:
description: The differences about the given arguments.
returned: success
type: complex
contains:
before:
description: The values before change
description: The values before change.
type: dict
after:
description: The values after change
description: The values after change.
type: dict
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Set timezone to Asia/Tokyo
become: true
community.general.timezone:
name: Asia/Tokyo
'''
"""
import errno
import os