Adding fallback mechanism to ntp validation role

It the 'chrony_enabled' key isn't found by hiera, the validation
will now proceed as if it was disabled. This should allow for successful
run on clouds with mix of ntp implementations.

Resolves: rhbz#2156049

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ic9860b3531639e85926f5221cd9c5cde03eecfa8
This commit is contained in:
Jiri Podivin 2023-01-02 14:38:26 +01:00
parent 978cd641f3
commit 879b056058

View File

@ -1,8 +1,14 @@
---
- name: Get if chrony is enabled
become: true
hiera:
name: "chrony_enabled"
block:
- hiera:
name: "chrony_enabled"
rescue:
- debug:
msg: "chrony_enabled key is not present. Assuming chrony is disabled"
- set_fact:
chrony_enabled: false
- when: chrony_enabled|bool
block: