From e35e22ea27afa5e1565a8f5a6c96748a660ea8c0 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Mon, 25 Mar 2024 16:59:53 +0000 Subject: [PATCH] coreos-base/misc-files: Add AWS/GPC time sync service to default ntp.conf The goal is to enable ntpd by default on AWS/GCP with using the cloud provided ntp endpoint. Enabling ntpd.service is the easy part. Enabling the correct ntp server is trickier. I would love to ship an OEM specific ntp.conf, but this might interfere with user modifications to either ntpd.service or ntp.conf. The safest way to implement this is to add the AWS/GCP time sync address (which are link-local address) to the default ntp.conf. This will work on AWS/GCP where ntpd will be enabled by default, and if a user on another platform enables ntpd they will simply have a non-responsive source in their server list - which is not a problem for ntpd. Signed-off-by: Jeremi Piotrowski --- .../coreos-base/misc-files/files/ntp/ntp.conf | 8 ++++++++ .../{misc-files-0-r4.ebuild => misc-files-0-r5.ebuild} | 0 2 files changed, 8 insertions(+) rename sdk_container/src/third_party/coreos-overlay/coreos-base/misc-files/{misc-files-0-r4.ebuild => misc-files-0-r5.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/misc-files/files/ntp/ntp.conf b/sdk_container/src/third_party/coreos-overlay/coreos-base/misc-files/files/ntp/ntp.conf index 9ed4dc176f..cc9a441b7b 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/misc-files/files/ntp/ntp.conf +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/misc-files/files/ntp/ntp.conf @@ -10,6 +10,14 @@ # Common pool for random people #server pool.ntp.org +# AWS Time Sync Service. +server 169.254.169.123 prefer iburst minpoll 4 maxpoll 4 +# AWS Time Sync Service IPv6: +server fd00:ec2::123 prefer iburst minpoll 4 maxpoll 4 + +# GCP NTP Service +server metadata.google.internal prefer iburst + # Pools for Flatcar users server 0.flatcar.pool.ntp.org server 1.flatcar.pool.ntp.org diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/misc-files/misc-files-0-r4.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/misc-files/misc-files-0-r5.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/misc-files/misc-files-0-r4.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/misc-files/misc-files-0-r5.ebuild