From fc60ace30cf12c9c6870c12a474783d9ef4db44f Mon Sep 17 00:00:00 2001
From: Jan Philipp Timme <jan.philipp@timme.it>
Date: Thu, 30 Jun 2022 10:46:14 +0200
Subject: [PATCH] Simplify removing ntp

---
 hshbase/time/files/ntp.conf | 35 -----------------------------------
 hshbase/time/init.sls       | 14 +-------------
 2 files changed, 1 insertion(+), 48 deletions(-)
 delete mode 100644 hshbase/time/files/ntp.conf

diff --git a/hshbase/time/files/ntp.conf b/hshbase/time/files/ntp.conf
deleted file mode 100644
index b69b658..0000000
--- a/hshbase/time/files/ntp.conf
+++ /dev/null
@@ -1,35 +0,0 @@
-{%- from "hshbase/map.jinja" import hshbase with context -%}
-### THIS FILE IS MANAGED BY SALT!
-### YOUR CHANGES WILL BE OVERWRITTEN!
-# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
-
-driftfile /var/lib/ntp/ntp.drift
-
-
-# Enable this if you want statistics to be logged.
-#statsdir /var/log/ntpstats/
-
-statistics loopstats peerstats clockstats
-filegen loopstats file loopstats type day enable
-filegen peerstats file peerstats type day enable
-filegen clockstats file clockstats type day enable
-
-
-# You do need to talk to an NTP server or two (or three).
-server {{ hshbase['time']['server'] }} iburst
-
-# pool.ntp.org maps to about 1000 low-stratum NTP servers.  Your server will
-# pick a different set every time it starts up.  Please consider joining the
-# pool: <http://www.pool.ntp.org/join.html>
-server 0.debian.pool.ntp.org iburst
-server 1.debian.pool.ntp.org iburst
-server 2.debian.pool.ntp.org iburst
-server 3.debian.pool.ntp.org iburst
-
-# By default, exchange time with everybody, but don't allow configuration.
-restrict -4 default kod notrap nomodify nopeer noquery
-restrict -6 default kod notrap nomodify nopeer noquery
-
-# Local users may interrogate the ntp server more closely.
-restrict 127.0.0.1
-restrict ::1
diff --git a/hshbase/time/init.sls b/hshbase/time/init.sls
index 1af41bf..3a7c27a 100644
--- a/hshbase/time/init.sls
+++ b/hshbase/time/init.sls
@@ -1,21 +1,9 @@
 {% from "hshbase/map.jinja" import hshbase with context %}
 
-hsh_disable_legacy_ntp_service:
-  service.disabled:
-    - name: ntp
-
-hsh_remove_legacy_ntp_conf:
-  file.absent:
-    - name: /etc/ntp.conf
-    - require:
-      - service:hsh_disable_legacy_ntp_service
-
+{# ensuring this is purged is enough, so systemd-timesyncd will work #}
 hsh_purge_legacy_ntp:
   pkg.purged:
     - name: ntp
-    - require:
-      - file:hsh_remove_legacy_ntp_conf
-
 
 hsh_server_timezone:
   timezone.system:
-- 
GitLab