Skip to content

Commit

Permalink
Add chrony for time sync for Azure image
Browse files Browse the repository at this point in the history
Chrony is the only way to sync time from host using PTP source according to the azure team
  • Loading branch information
nader-ziada committed May 21, 2020
1 parent c680d2c commit 39a5c8c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions images/capi/ansible/roles/providers/tasks/azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,27 @@
vars:
packages:
- azure-cli

- name: Ansible apt install chrony
apt:
name: chrony
state: present

- name: Configure PTP
lineinfile:
path: /etc/chrony/chrony.conf
create: yes
line: refclock PHC /dev/ptp0 poll 3 dpoll -2 offset 0

- name: Ensure makestep parameter set as per Azure recommendation
lineinfile:
path: /etc/chrony/chrony.conf
regexp: '^makestep'
line: makestep 1.0 -1

- name: Enable chrony.service
systemd:
enabled: yes
state: started
daemon_reload: yes
name: chrony.service

0 comments on commit 39a5c8c

Please sign in to comment.