Open probitcarwyn opened 2 months ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @indrajitr @jasperla @tmshn click here for bot help
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:
https://github.com/ansible-collections/community.general/blob/e5bc38d856b3db0c436ccf63538bd8def9594dca/plugins/modules/timezone.py#L117-L121
But then the
SystemdTimezone
code path only usestimedatectl
to update the/etc/localtime
symlink, but does not update
/etc/timezone`.https://github.com/ansible-collections/community.general/blob/e5bc38d856b3db0c436ccf63538bd8def9594dca/plugins/modules/timezone.py#L290-L296
... while the code path for
NosystemdTimezone
does edit/etc/timezone
:https://github.com/ansible-collections/community.general/blob/e5bc38d856b3db0c436ccf63538bd8def9594dca/plugins/modules/timezone.py#L363-L384
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