Skip to content

Commit

Permalink
chrony: check min number of servers (#1554)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt authored Aug 22, 2024
1 parent 807eb84 commit e82a3b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roles/chrony/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ chrony_bind_local_interfaces_only: true
# Bind Chrony to specific addresses
# NOTE: It is only possible to set at most one IPv4 and one IPv6 address.
chrony_bindaddresses: []

chrony_minimum_number_of_servers: 2
8 changes: 8 additions & 0 deletions roles/chrony/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
---
- name: Check minimum and maximum number of servers
ansible.builtin.fail:
msg: >
A minimum of {{ chrony_minimum_number_of_servers }} of server(s) must
be configured. Currently {{ chrony_servers | length }} server(s) are
configured.
when: chrony_servers | length < chrony_minimum_number_of_servers | int

- name: Gather variables for each operating system
ansible.builtin.include_vars: "{{ ansible_os_family }}-family.yml"

Expand Down

0 comments on commit e82a3b1

Please sign in to comment.