Modify playbook to function with chrony 588/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 13 Nov 2020 17:04:42 +0000 (12:04 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Fri, 13 Nov 2020 17:04:42 +0000 (12:04 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
tools/prep-fog-capture.yml

index b389e85296dc1c6244fad9d21d327bebbe1f0954..543869c502290451d45c33df7f7bec13ee266f77 100644 (file)
     service:
       name: "{{ ntp_service }}"
       state: stopped
+    when: '"ntp" in ntp_service'
 
   # The theory here is although we do have the ntp service running on boot,
   # if the time is off, it slowly drifts back in sync.  Since our testnodes
   # are ephemeral, they don't ever have enough time to correctly drift
   # back to the correct time.  So we'll force it in the captured OS images.
-  - name: Force time synchronization using stepping
+  - name: Force time synchronization using stepping | ntp
     command: "ntpdate -b {{ ntp_servers|join(' ') }}"
-    # Fix after RHEL8 GAs!
-    ignore_errors: true
+    when: '"ntp" in ntp_service'
 
-  - name: "Start {{ ntp_service }} again"
+  - name: "Start {{ ntp_service }}"
     service:
       name: "{{ ntp_service }}"
       state: started
 
+  # chronyd needs to be started in order to force time sync. This differs from ntpd.
+  - name: Force time synchronization using stepping | chrony
+    command: chronyc -a makestep
+    when: '"chrony" in ntp_service'
+
   - name: Sync the hardware clock
     command: "hwclock --systohc"