From 2f393868fccc66d06f118c83b9569f62175a78b9 Mon Sep 17 00:00:00 2001 From: Francesco Trentini Date: Fri, 12 Apr 2024 11:28:58 +0200 Subject: [PATCH] add timesync_chrony_service_settings variable Signed-off-by: Francesco Trentini --- README.md | 5 +++++ defaults/main.yml | 1 + templates/chronyd.sysconfig.j2 | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 78b7092b..3664873a 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,11 @@ timesync_ntp_provider: chrony timesync_chrony_custom_settings: - "logdir /var/log/chrony" - "log measurements statistics tracking" + +# List of daeomn options that will be configured at startup of the services +# using 'OPTIONS' variable in '/etc/sysconfig/chronyd'. For all available +# options, see 'chronyd(8)' man page. +timesync_chrony_service_settings: [] ``` ## Example Playbooks diff --git a/defaults/main.yml b/defaults/main.yml index 1aa23c63..71b19918 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,3 +7,4 @@ timesync_min_sources: 1 timesync_ntp_hwts_interfaces: [] timesync_ntp_provider: "" timesync_max_distance: 0 +timesync_chrony_service_settings: [] diff --git a/templates/chronyd.sysconfig.j2 b/templates/chronyd.sysconfig.j2 index 600487fc..c0ecf480 100644 --- a/templates/chronyd.sysconfig.j2 +++ b/templates/chronyd.sysconfig.j2 @@ -1,4 +1,4 @@ {{ ansible_managed | comment }} {{ "system_role:timesync" | comment(prefix="", postfix="") }} -OPTIONS="" +OPTIONS="{{ timesync_chrony_service_settings | default([]) | join(' ') }}"