From 76f76a0ca41454325be38ad307c924c8e3f7ce4c Mon Sep 17 00:00:00 2001 From: Jeltz Date: Sat, 27 Aug 2022 06:52:38 +0200 Subject: [PATCH] ntp: add logdir + local + logchange support --- playbooks/chronyd.yml | 1 + roles/chronyd/defaults/main.yml | 2 ++ roles/chronyd/templates/chrony.conf.j2 | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/playbooks/chronyd.yml b/playbooks/chronyd.yml index e7b629e..b2a5c56 100755 --- a/playbooks/chronyd.yml +++ b/playbooks/chronyd.yml @@ -11,6 +11,7 @@ - 1.pool.ntp.org - 2.pool.ntp.org - 3.pool.ntp.org + chronyd__local_stratum: 10 roles: - chronyd diff --git a/roles/chronyd/defaults/main.yml b/roles/chronyd/defaults/main.yml index 8355138..8214c05 100644 --- a/roles/chronyd/defaults/main.yml +++ b/roles/chronyd/defaults/main.yml @@ -3,7 +3,9 @@ chronyd__pools: [] chronyd__key_file: /etc/chrony/chrony.keys chronyd__drift_file: /var/lib/chrony/chrony.drift chronyd__nts_dump_dir: /var/lib/chrony +chronyd__log_dir: /var/log/chrony chronyd__max_update_skew: 100.0 chronyd__rtcsync: true chronyd__allow_networks: [] +chronyd__log_change_seconds: 0.5 ... diff --git a/roles/chronyd/templates/chrony.conf.j2 b/roles/chronyd/templates/chrony.conf.j2 index 2e896ba..2db858a 100644 --- a/roles/chronyd/templates/chrony.conf.j2 +++ b/roles/chronyd/templates/chrony.conf.j2 @@ -7,6 +7,7 @@ pool {{ pool }} iburst keyfile {{ chronyd__key_file }} driftfile {{ chronyd__drift_file }} ntsdumpdir {{ chronyd__nts_dump_dir }} +logdir {{ chronyd__log_dir }} log tracking measurements statistics @@ -16,6 +17,12 @@ maxupdateskew {{ chronyd__max_update_skew | float }} rtcsync {% endif %} +{% if chronyd__local_stratum is defined %} +local stratum {{ chronyd__local_stratum | int }} +{% endif %} + +logchange {{ chronyd__log_change_seconds | float }} + leapsectz right/UTC {% for network in chronyd__allow_networks %}