From: Zack Cerza Date: Wed, 20 Jan 2016 20:56:04 +0000 (-0700) Subject: On CentOS 6, set the hardware clock X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=bb809c6df5d9de5da8630379e5c12cc70ff67156;p=ceph-cm-ansible.git On CentOS 6, set the hardware clock /etc/localtime on its own doesn't cause the hardware clock to be reset (at least immediately). So, do that. Signed-off-by: Zack Cerza --- diff --git a/roles/common/tasks/yum_systems.yml b/roles/common/tasks/yum_systems.yml index a7cdb23..3b67438 100644 --- a/roles/common/tasks/yum_systems.yml +++ b/roles/common/tasks/yum_systems.yml @@ -15,7 +15,7 @@ tags: - timezone -- name: Set the timezone (RHEL/CentOS 6) +- name: Set /etc/localtime (RHEL/CentOS 6) file: src: /usr/share/zoneinfo/{{ timezone }} dest: /etc/localtime @@ -26,6 +26,12 @@ tags: - timezone +- name: Set the hardware clock (RHEL/CentOS 6) + command: hwclock --systohc + when: ansible_distribution_major_version == "6" and current_tz.stdout|default("") != timezone + tags: + - timezone + - name: Set the timezone (RHEL/CentOS 7) command: timedatectl set-timezone {{ timezone }} # Default is used below to avoid breaking check mode