From 4f93502f502e61ac7e4941854491d00a5f33465b Mon Sep 17 00:00:00 2001 From: 135 Date: Wed, 30 Aug 2023 00:29:51 +0300 Subject: [PATCH] chronyd disable --- tasks/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index bcf027c..40600f8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,6 +4,13 @@ - name: "set timezone" community.general.timezone: name: "{{ timezone }}" + + - name: "install systemd-timesyncd" + apt: + name: "systemd-timesyncd" + autoremove: true + update_cache: true + - name: "configure systemd-timesyncd" lineinfile: path: /etc/systemd/timesyncd.conf @@ -12,9 +19,18 @@ loop: - { 'regexp': '^#*NTP=.*$', 'line': 'NTP={{ ntp | default("") | join(" ") }}'} - { 'regexp': '^#*FallbackNTP=.*$', 'line': 'FallbackNTP={{ fallback_ntp | default("") | join(" ") }}'} + + - name: "stop and disable chronyd" + service: + name: chrony.service + enabled: no + masked: yes + state: stopped + - name: "start and enable systemd-timesyncd" service: name: systemd-timesyncd.service enabled: yes state: started + masked: no notify: systemd-timesyncd configuration changed