2021-03-06 15:12:30 +01:00
|
|
|
---
|
2021-03-06 15:23:36 +01:00
|
|
|
- name: restart ntpd
|
|
|
|
become: yes
|
|
|
|
systemd:
|
|
|
|
name: systemd-timesyncd
|
|
|
|
enabled: no
|
|
|
|
state: stopped
|
|
|
|
masked: yes
|
|
|
|
|
2021-03-06 15:12:30 +01:00
|
|
|
- name: install ntp packages
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.package:
|
|
|
|
name:
|
|
|
|
- ntp
|
|
|
|
- ntpdate
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Create ntp driftfile folder
|
|
|
|
become: yes
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
path: "{{ ntp_driftfile_directory }}"
|
|
|
|
mode: 0644
|
|
|
|
owner: "{{ ntp_daemon_user }}"
|
|
|
|
group: "{{ ntp_daemon_group }}"
|
|
|
|
|
|
|
|
- name: create ntp.conf
|
|
|
|
become: yes
|
|
|
|
template:
|
|
|
|
src: "ntp.conf.j2"
|
|
|
|
dest: "/etc/ntp.conf"
|
|
|
|
mode: 0644
|
|
|
|
notify:
|
|
|
|
- restart ntpd
|
|
|
|
|
|
|
|
- name: set Zeitzone to {{ ntp_timezone }}
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.timezone:
|
|
|
|
name: "{{ ntp_timezone }}"
|