Skip to content

Commit 4b489b0

Browse files
authored
Merge pull request #302 from stackhpc/rabbitmq-reset-timecheck
Fail if the controller clocks are not synced
2 parents 7d43808 + 097c985 commit 4b489b0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

etc/kayobe/ansible/rabbitmq-reset.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@
1111
vars:
1212
- container_name: rabbitmq
1313
tasks:
14+
- name: Checking timedatectl status
15+
become: true
16+
command: timedatectl status
17+
register: timedatectl_status
18+
changed_when: false
19+
20+
- name: Fail if the clock is not synchronized
21+
fail:
22+
msg: >-
23+
timedatectl sees the system clock as unsynchronized.
24+
You may need to force synchronisation using `chronyc makestep`.
25+
Otherwise, please wait for synchronization.
26+
when:
27+
- "'synchronized: yes' not in timedatectl_status.stdout"
28+
1429
- name: Inspect the {{ container_name }} container
1530
shell:
1631
cmd: "docker container inspect --format '{{ '{{' }} .State.Running {{ '}}' }}' {{ container_name }}"

0 commit comments

Comments
 (0)