[LXC] Force lxc containers to be in the correct timezone
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
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).
This commit is contained in:
parent
eeeb20771a
commit
23a486dc9a
|
@ -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 }}"
|
||||
|
|
Loading…
Reference in a new issue