Skip to content

Commit

Permalink
Use _guard_var templates for timesync services on Ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
mpurg committed Jan 27, 2025
1 parent 8efaab3 commit 751dfc0
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
10 changes: 10 additions & 0 deletions linux_os/guide/services/ntp/service_chronyd_disabled/rule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ severity: medium

platform: package[chrony]

{{%- if product in [ "ubuntu2404" ] %}}
template:
name: service_disabled_guard_var
vars:
packagename: chrony
servicename: chrony
variable: var_timesync_service
value: chronyd
{{%- else %}}
template:
name: service_disabled
vars:
Expand All @@ -21,3 +30,4 @@ template:
servicename@ubuntu2004: chrony
servicename@ubuntu2204: chrony
servicename@debian12: chrony
{{%- endif %}}
10 changes: 10 additions & 0 deletions linux_os/guide/services/ntp/service_chronyd_enabled/rule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ fixtext: '{{{ fixtext_service_enabled(service="chronyd") }}}'

srg_requirement: '{{{ srg_requirement_service_enabled(service="chronyd") }}}'

{{%- if product in [ "ubuntu2404" ] %}}
template:
name: service_enabled_guard_var
vars:
packagename: chrony
servicename: chrony
variable: var_timesync_service
value: chronyd
{{%- else %}}
template:
name: service_enabled
vars:
Expand All @@ -49,3 +58,4 @@ template:
servicename@ubuntu2004: chrony
servicename@ubuntu2204: chrony
servicename@debian12: chrony
{{%- endif %}}
11 changes: 10 additions & 1 deletion linux_os/guide/services/ntp/service_timesyncd_disabled/rule.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
documentation_complete: true


title: 'Disable systemd_timesyncd Service'

description: |-
Expand All @@ -18,8 +17,18 @@ severity: medium

platform: package[systemd-timesyncd]

{{%- if product in [ "ubuntu2404" ] %}}
template:
name: service_disabled_guard_var
vars:
packagename: systemd-timesyncd
servicename: systemd-timesyncd
variable: var_timesync_service
value: systemd-timesyncd
{{%- else %}}
template:
name: service_disabled
vars:
servicename: systemd-timesyncd
packagename: systemd-timesyncd
{{%- endif %}}
10 changes: 10 additions & 0 deletions linux_os/guide/services/ntp/service_timesyncd_enabled/rule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,18 @@ references:
ocil: |-
{{{ ocil_service_enabled(service="systemd_timesyncd") }}}
{{%- if product in [ "ubuntu2404" ] %}}
template:
name: service_enabled_guard_var
vars:
packagename: systemd-timesyncd
servicename: systemd-timesyncd
variable: var_timesync_service
value: systemd-timesyncd
{{%- else %}}
template:
name: service_enabled
vars:
servicename: systemd-timesyncd
packagename: systemd
{{%- endif %}}

0 comments on commit 751dfc0

Please sign in to comment.