chronyd disable

This commit is contained in:
135
2023-08-30 00:29:51 +03:00
parent fac600c19e
commit 4f93502f50

View File

@@ -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