From 72bf1c2212a813da0ca4dbcd73cd9f15ed3a9878 Mon Sep 17 00:00:00 2001 From: Mathias Gibbens Date: Tue, 10 Sep 2024 16:04:16 -0600 Subject: [PATCH] Ensure NTP is successfully synced on all servers If time isn't synchronized across the cluster, clock skew can lead to certificate validity issues when trying to join new servers to the cluster. Signed-off-by: Mathias Gibbens --- ansible/books/env-checks.yaml | 11 +++++++++++ ansible/deploy.yaml | 1 + 2 files changed, 12 insertions(+) create mode 100644 ansible/books/env-checks.yaml diff --git a/ansible/books/env-checks.yaml b/ansible/books/env-checks.yaml new file mode 100644 index 0000000..6629d0a --- /dev/null +++ b/ansible/books/env-checks.yaml @@ -0,0 +1,11 @@ +--- +- name: Environment checks + hosts: all + order: shuffle + any_errors_fatal: true + tasks: + - name: Verify NTP successfully synced + shell: + cmd: timedatectl timesync-status + register: ntp_status_output + failed_when: '"Packet count: 0" in ntp_status_output.stdout' diff --git a/ansible/deploy.yaml b/ansible/deploy.yaml index 1ea5c2b..1d35cc1 100644 --- a/ansible/deploy.yaml +++ b/ansible/deploy.yaml @@ -1,3 +1,4 @@ +- import_playbook: books/env-checks.yaml - import_playbook: books/ceph.yaml - import_playbook: books/lvmcluster.yaml - import_playbook: books/ovn.yaml