From: David Galloway Date: Mon, 9 Apr 2018 20:36:07 +0000 (-0400) Subject: common: Always set the hwclock on all systems X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Fwip-hwclock;p=ceph-cm-ansible.git common: Always set the hwclock on all systems Even if the OS time is correct, the hardware clock could be off. There's no harm in making sure it is accurate with every job. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-Configuring_the_Date_and_Time-hwclock Signed-off-by: David Galloway --- diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index f6899ed3..0425daf2 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -25,6 +25,11 @@ - import_tasks: zypper_systems.yml when: ansible_pkg_mgr == "zypper" +- name: Set the hardware clock + command: hwclock --systohc + tags: + - timezone + # configure Kerberos - import_tasks: kerberos.yml tags: diff --git a/roles/common/tasks/yum_systems.yml b/roles/common/tasks/yum_systems.yml index 562142b1..3ef2b3b3 100644 --- a/roles/common/tasks/yum_systems.yml +++ b/roles/common/tasks/yum_systems.yml @@ -26,12 +26,6 @@ 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