From fa1b16715868a67d7498d74c2f6c3a440b01a9cd Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Tue, 16 Jul 2024 14:17:15 -0500 Subject: [PATCH 1/5] fix(base): disable ntp installed on noble --- salt/base/sanity.sls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/salt/base/sanity.sls b/salt/base/sanity.sls index 33acfa66..b55bfe2a 100644 --- a/salt/base/sanity.sls +++ b/salt/base/sanity.sls @@ -5,6 +5,7 @@ niceties: - htop - traceroute +{% if grains["oscodename"] != "noble" %} time-sync: pkg.installed: - pkgs: @@ -15,7 +16,7 @@ ntp: service: - running - enable: True - +{% endif %} # Cron has a default $PATH of only /usr/bin:/bin, however the root user's # default $PATH in the shell includes various sbin directories. This can cause From da270e110440cc3c6c363c4797f8e10ecd2e420d Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Tue, 16 Jul 2024 16:25:39 -0500 Subject: [PATCH 2/5] feat(base): add timesyncd state --- salt/base/sanity.sls | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/salt/base/sanity.sls b/salt/base/sanity.sls index b55bfe2a..0a8f5807 100644 --- a/salt/base/sanity.sls +++ b/salt/base/sanity.sls @@ -5,8 +5,18 @@ niceties: - htop - traceroute -{% if grains["oscodename"] != "noble" %} -time-sync: +{% if grains["oscodename"] in ["noble"] %} +time-sync-timesyncd: + pkg.installed: + - pkgs: + - systemd-timesyncd + +systemd-timesyncd: + service: + - running + - enable: True +{% else %} +time-sync-ntp pkg.installed: - pkgs: - ntp From 3b1a5b2a793c1d537f138e2f5e3e881ba20d573b Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Tue, 16 Jul 2024 16:28:04 -0500 Subject: [PATCH 3/5] Update salt/base/sanity.sls --- salt/base/sanity.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/base/sanity.sls b/salt/base/sanity.sls index 0a8f5807..9236a977 100644 --- a/salt/base/sanity.sls +++ b/salt/base/sanity.sls @@ -16,7 +16,7 @@ systemd-timesyncd: - running - enable: True {% else %} -time-sync-ntp +time-sync-ntp: pkg.installed: - pkgs: - ntp From ad5788177e30015fd0326fe98f451cd8139b2af0 Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Wed, 17 Jul 2024 08:09:41 -0500 Subject: [PATCH 4/5] chore: simplify code block --- salt/base/sanity.sls | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/salt/base/sanity.sls b/salt/base/sanity.sls index 9236a977..f02556b7 100644 --- a/salt/base/sanity.sls +++ b/salt/base/sanity.sls @@ -6,17 +6,14 @@ niceties: - traceroute {% if grains["oscodename"] in ["noble"] %} -time-sync-timesyncd: - pkg.installed: - - pkgs: - - systemd-timesyncd - systemd-timesyncd: - service: - - running - - enable: True + pkg: + - installed + service: + - running + - enable: True {% else %} -time-sync-ntp: +ntp-packages: pkg.installed: - pkgs: - ntp From 3c9b7534aa69b5792cdaba27748b13dbeedd6e7b Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Wed, 17 Jul 2024 09:29:33 -0500 Subject: [PATCH 5/5] feat: add new custom grain check for containers --- salt/base/sanity.sls | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/salt/base/sanity.sls b/salt/base/sanity.sls index f02556b7..714d1e77 100644 --- a/salt/base/sanity.sls +++ b/salt/base/sanity.sls @@ -10,8 +10,12 @@ systemd-timesyncd: pkg: - installed service: + {% if grains["detect_virt"] in ["docker"] %} + - enabled + {% else %} - running - enable: True + {% endif %} {% else %} ntp-packages: pkg.installed: