Compare commits

...

6 Commits

Author SHA1 Message Date
Mathieu Trossevin f026883d4f
Merge remote-tracking branch 'origin/unstable' into change_timezone 2020-12-23 14:56:25 +01:00
Mathieu 18ce6a7a57 Merge branch 'unstable' into change_timezone 2020-12-09 09:16:34 +01:00
Mathieu Trossevin 0defe8b6f1
Merge branch 'unstable' into change_timezone 2020-10-28 15:14:48 +01:00
Mathieu Trossevin 0618c18b4e
Update changelog: force lxc containers to be in correct TZ 2020-10-20 17:20:31 +02:00
Mathieu Trossevin 4295383d43
Merge branch 'unstable' into change_timezone 2020-10-20 17:19:06 +02:00
Mathieu Trossevin 23a486dc9a
[LXC] Force lxc containers to be in the correct timezone
Right now lxc containers are in the Etc/UTC timezone, this commit change
it so that they are in the same timezone as the host by copying
/etc/timezone and /etc/localtime (without dereferencing it) inside of
the container.

It might not be able to survive an update of the tzdata package however.
(Debian shouldn't change manual configuration upon update but they chose
to anyways so bear with it).
2020-07-27 11:53:03 +02:00
2 changed files with 19 additions and 0 deletions

View File

@ -18,6 +18,8 @@ The **patch** part changes incrementally at each release.
### Fixed
* lxc: Force lxc containers to be in the correct timezone
### Removed
### Security

View File

@ -52,6 +52,23 @@
insertbefore: "^exit 0$"
when: release == 'jessie'
- name: "Force container {{ name }} to be in the correct timezone [1/2]"
copy:
src: "/etc/timezone"
dest: "/var/lib/lxc/{{ name }}/rootfs/etc/timezone"
force: yes
owner: root
group: root
- name: "Force container {{ name }} to be in the correct timezone [2/2]"
copy:
src: "/etc/localtime"
dest: "/var/lib/lxc/{{ name }}/rootfs/etc/localtime"
force: yes
local_follow: no
owner: root
group: root
- name: "Ensure that {{ name }} container is running"
lxc_container:
name: "{{ name }}"