homeserver/roles/mgrote.ntp/tasks/main.yml

39 lines
786 B
YAML
Raw Normal View History

---
- name: mask systemd-timesyncd
become: yes
systemd:
name: systemd-timesyncd
state: stopped
masked: yes
- 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 }}"