Skip to content

Commit

Permalink
Mask systemd-timesyncd only when it is loaded (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-ro authored Nov 8, 2021
1 parent 3ed2597 commit 7766d95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tasks/prelim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@
changed_when: false
check_mode: false

- name: "PRELIM | Check for systemd-timesyncd service"
shell: "set -o pipefail;
systemctl show systemd-timesyncd | grep LoadState | cut -d = -f 2"
args:
executable: /bin/bash
register: systemd_timesyncd_service_status
changed_when: false
check_mode: false

- name: "PRELIM | Check for avahi-daemon service"
shell: "set -o pipefail;
systemctl show avahi-daemon | grep LoadState | cut -d = -f 2"
Expand Down
2 changes: 1 addition & 1 deletion tasks/section2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
masked: yes
when:
- ubuntu2004cis_time_synchronization == "ntp"
- chronyd_service_status.stdout == "loaded"
- systemd_timesyncd_service_status.stdout == "loaded"

when:
- ubuntu2004cis_rule_2_2_1_1
Expand Down

0 comments on commit 7766d95

Please sign in to comment.