From dabdc1601012aaa8949e4ea0fb009315cf6d3032 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 12:45:07 +0100 Subject: [PATCH] [PR #11685/909458a6 backport][stable-11] docs: improve timezone module examples and add hwclock usage (#11695) docs: improve timezone module examples and add hwclock usage (#11685) * docs: add variable-based example for timezone module ### Summary Added a variable-based example to the EXAMPLES section of the timezone module. ### Changes - Added an example demonstrating how to set timezone dynamically using a variable ### Motivation Using variables is a common practice in Ansible playbooks. This example helps users understand how to make the module usage more flexible and reusable. * docs: improve timezone module examples with hwclock usage ### Summary Improved the EXAMPLES section of the timezone module by adding a more meaningful, module-specific example. ### Changes - Added an example demonstrating usage of the `hwclock` parameter - Simplified examples to avoid redundancy - Fixed formatting issues causing CI failures (invalid YAML, lint errors) ### Motivation The previous examples were minimal and did not demonstrate module-specific features. This update adds a more practical use case and ensures the examples follow proper formatting and validation rules. (cherry picked from commit 909458a66134428785202b068a40ccb28aae6ec6) Co-authored-by: Anshjeet Mahir --- plugins/modules/timezone.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/modules/timezone.py b/plugins/modules/timezone.py index 5b8cc67c79..bc5996219f 100644 --- a/plugins/modules/timezone.py +++ b/plugins/modules/timezone.py @@ -62,6 +62,11 @@ EXAMPLES = r""" become: true community.general.timezone: name: Asia/Tokyo + +- name: Set timezone and hardware clock to UTC + community.general.timezone: + name: UTC + hwclock: UTC """ import errno