summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinichi TAMURA <shnch.tmr@gmail.com>2018-01-31 08:34:45 +0900
committeransibot <ansibot@users.noreply.github.com>2018-01-30 18:34:45 -0500
commitfec85a42a6502fe986fdd2512963e6cd4fb842a4 (patch)
treeb1e29a4b385c2f00395d4bb9d37b2347591c92b4
parentac7e62ec08d10df30b76ffd035b8d449a1a097d9 (diff)
downloadansible-fec85a42a6502fe986fdd2512963e6cd4fb842a4.tar.gz
timezone module: Enhanced update command for Debian/Ubuntu (#34390)
* timezone module: Symlink to /etc/localtime before dpkg-reconfigure in Debian/Ubuntu * timezone module: Symlink rather than hard link
-rw-r--r--lib/ansible/modules/system/timezone.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ansible/modules/system/timezone.py b/lib/ansible/modules/system/timezone.py
index 283a7c98f3..315bc51681 100644
--- a/lib/ansible/modules/system/timezone.py
+++ b/lib/ansible/modules/system/timezone.py
@@ -336,9 +336,8 @@ class NosystemdTimezone(Timezone):
# Distribution-specific configurations
if self.module.get_bin_path('dpkg-reconfigure') is not None:
# Debian/Ubuntu
- # With additional hack for https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/1554806
- self.update_timezone = ['rm -f /etc/localtime', '%s --frontend noninteractive tzdata' %
- self.module.get_bin_path('dpkg-reconfigure', required=True)]
+ self.update_timezone = ['%s -sf %s /etc/localtime' % (self.module.get_bin_path('ln', required=True), tzfile),
+ '%s --frontend noninteractive tzdata' % self.module.get_bin_path('dpkg-reconfigure', required=True)]
self.conf_files['name'] = '/etc/timezone'
self.allow_no_file['name'] = True
self.conf_files['hwclock'] = '/etc/default/rcS'