From 1b67ecfc259382e0cc814851b2dce0957078cdfe Mon Sep 17 00:00:00 2001 From: Pavan-Gunda Date: Wed, 10 Apr 2024 08:45:53 +0200 Subject: [PATCH] Fixed config to only have one variable --- roles/kubernetes/preinstall/defaults/main.yml | 5 +++-- roles/kubernetes/preinstall/templates/ntp.conf.j2 | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/roles/kubernetes/preinstall/defaults/main.yml b/roles/kubernetes/preinstall/defaults/main.yml index 12cbcbc5a68..de043a5441f 100644 --- a/roles/kubernetes/preinstall/defaults/main.yml +++ b/roles/kubernetes/preinstall/defaults/main.yml @@ -102,8 +102,9 @@ ntp_restrict: ntp_filter_interface: false # Specify the interfaces # Only takes effect when ntp_filter_interface is true -ntp_interfaces: - - ens3 +# ntp_interfaces: +# - ignore wildcard +# - listen xxx # The NTP driftfile path # Only takes effect when ntp_manage_config is true. ntp_driftfile: /var/lib/ntp/ntp.drift diff --git a/roles/kubernetes/preinstall/templates/ntp.conf.j2 b/roles/kubernetes/preinstall/templates/ntp.conf.j2 index 46511dc335b..1a5c69c1b69 100644 --- a/roles/kubernetes/preinstall/templates/ntp.conf.j2 +++ b/roles/kubernetes/preinstall/templates/ntp.conf.j2 @@ -35,10 +35,10 @@ restrict -6 default kod notrap nomodify nopeer noquery limited restrict {{ item }} {% endfor %} +# Needed for filtering interfaces {% if ntp_filter_interface %} -interface ignore wildcard -{% for item in ntp_listen %} -interface listen {{ item }} +{% for item in ntp_interfaces %} +interface {{ item }} {% endfor %} {% endif %}