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 Jun 1, 2020
1 parent c680d2c commit 58794c3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 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,31 @@
vars:
packages:
- azure-cli

- name: Ansible apt install chrony
apt:
name: chrony
state: present
when: ansible_distribution == "Ubuntu"

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

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

- name: Enable chrony.service
systemd:
enabled: yes
state: started
daemon_reload: yes
name: chrony.service
when: ansible_distribution == "Ubuntu"

0 comments on commit 58794c3

Please sign in to comment.