You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The community.general.timezone module incorrectly assumes systemd based Debian 12 doesn't need the contents of the /etc/timezone to be altered on Debian 12 (bookworm).
Consider the localtime(5) link as the primary source and /etc/timezone as a legacy. During Bookworm release cycle there was an attempt to get rid of /etc/timezone (822733), but it was restored for a while since there is a number of packages still relying on it (1031395).
The Ansible timezone module has distinct code paths for Systemd vs Non-Systemd based systems that basically does:
Uses timedatectl (seemingly exclusively) for systemd based systems.
Mangles distro specific files for the non systemd case.
Debian 12 (bookworm) is correctly detected as a systemd based system, but as per the Debian docs linked above, Debian 12 still needs /etc/timezone edited as well.
tasks:
- name: Set Time Zonecommunity.general.timezone:
name: "Europe/London"
Expected Results
Expected all files that need changing on Debian 12 (bookworm) as per https://wiki.debian.org/TimeZoneChanges to be updated with the Europe/London timezone data.
Actual Results
While the /etc/localtime symlink is updated to point at the correct timezone file.
The contents of the /etc/timezone file is not changed.
Code of Conduct
I agree to follow the Ansible Code of Conduct
The text was updated successfully, but these errors were encountered:
Summary
The
community.general.timezone
module incorrectly assumes systemd based Debian 12 doesn't need the contents of the/etc/timezone
to be altered on Debian 12 (bookworm).Debian tried to remove the use of
/etc/timezone
in Debian 12 (bookworm) as noted in: https://wiki.debian.org/TimeZoneChangesThe Ansible
timezone
module has distinct code paths for Systemd vs Non-Systemd based systems that basically does:Debian 12 (bookworm) is correctly detected as a
systemd
based system, but as per the Debian docs linked above, Debian 12 still needs/etc/timezone
edited as well.The code that detects systemd is here:
community.general/plugins/modules/timezone.py
Lines 117 to 121 in e5bc38d
But then the
SystemdTimezone
code path only usestimedatectl
to update the/etc/localtime
symlink, but does not update
/etc/timezone`.community.general/plugins/modules/timezone.py
Lines 290 to 296 in e5bc38d
... while the code path for
NosystemdTimezone
does edit/etc/timezone
:community.general/plugins/modules/timezone.py
Lines 363 to 384 in e5bc38d
Issue Type
Bug Report
Component Name
timezone
Ansible Version
Community.general Version
Configuration
OS / Environment
Fedora 40
Steps to Reproduce
Expected Results
Expected all files that need changing on Debian 12 (bookworm) as per https://wiki.debian.org/TimeZoneChanges to be updated with the Europe/London timezone data.
Actual Results
While the
/etc/localtime
symlink is updated to point at the correct timezone file.The contents of the
/etc/timezone
file is not changed.Code of Conduct
The text was updated successfully, but these errors were encountered: