Ansible-Linux_Base/roles/base/tasks/debian_time_sync.yml

36 lines
681 B
YAML
Raw Normal View History

2021-09-01 17:31:49 -06:00
---
# file: roles/base/tasks/debian_time_sync.yml
- name: Install chrony
package:
name: chrony
state: latest
- name: Set refclock
lineinfile:
path: /etc/chrony/chrony.conf
line: 'refclock PHC /dev/ptp0 trust poll 1 filter 4'
insertafter: EOF
- name: Set makestep
lineinfile:
path: /etc/chrony/chrony.conf
regexp: '^makestep '
line: 'makestep 1 -1'
- name: Disable systemd-timesyncd
service:
name: systemd-timesyncd
state: stopped
enabled: false
- name: Enable chrony
service:
name: chronyd
state: started
enabled: true
- name: Set timezone to defined variable
timezone:
name: "{{ base_core_timezone }}"