Skip to content

Commit

Permalink
Merge pull request #403 from Azure/time-sync
Browse files Browse the repository at this point in the history
added chrony setup
  • Loading branch information
xpillons authored Jun 25, 2021
2 parents de5e6f6 + 26c66ac commit e25bb5a
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ jobs:
RESOURCE_GROUP=${{needs.deploy.outputs.resource_group}}
./azhop_state.sh download ${{ env.AZHOP_STATE_ACCOUNT }} ${{ env.AZHOP_STATE_CONTAINER }} $RESOURCE_GROUP
./install.sh telegraf
./install.sh chrony
build_image:
name: build_image
Expand Down
5 changes: 3 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ case $TARGET in
ansible-playbook -i playbooks/inventory ./playbooks/scheduler.yml
ansible-playbook -i playbooks/inventory ./playbooks/ood.yml --extra-vars=@playbooks/ood-overrides.yml
ansible-playbook -i playbooks/inventory ./playbooks/grafana.yml
ansible-playbook -i playbooks/inventory ./playbooks/telegraf.yml
ansible-playbook -i playbooks/inventory ./playbooks/telegraf.yml
ansible-playbook -i playbooks/inventory ./playbooks/chrony.yml
;;
lustre)
ansible-playbook -i playbooks/inventory ./playbooks/lustre-sas.yml
ansible-playbook -i playbooks/inventory ./playbooks/lustre.yml
;;
ad | linux | add_users | ccportal | ccpbs | scheduler | grafana | telegraf)
ad | linux | add_users | ccportal | chrony | ccpbs | scheduler | grafana | telegraf)
ansible-playbook -i playbooks/inventory ./playbooks/$TARGET.yml
;;
ood)
Expand Down
50 changes: 50 additions & 0 deletions playbooks/chrony.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
- hosts: ondemand
become: true
vars_files:
- '{{global_config_file}}'

tasks:
- name: set main chrony conf file
copy:
dest: /etc/chrony.conf
mode: 0644
content: |
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
driftfile /var/lib/chrony/drift
makestep 1.0 -1
rtcsync
allow 10.0.0.0/16
logdir /var/log/chrony
refclock PHC /dev/ptp_hyperv poll 3 dpoll -2 offset 0
- name: enable and start chronyd
service:
name: chronyd
enabled: yes
state: started

- hosts: jumpbox, scheduler, ccportal, lustre, lustre-oss-*, robinhood
become: true
vars_files:
- '{{global_config_file}}'

tasks:
- name: set node chrony conf file
copy:
dest: /etc/chrony.conf
mode: 0644
content: |
server ondemand
driftfile /var/lib/chrony/drift
makestep 1.0 -1
rtcsync
logdir /var/log/chrony
refclock PHC /dev/ptp_hyperv poll 3 dpoll -2 offset 0
- name: enable and start chronyd
service:
name: chronyd
enabled: yes
state: started

14 changes: 14 additions & 0 deletions playbooks/roles/cyclecloud_pbs/cluster-init/scripts/7-chronyd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

cat <<EOF >/etc/chrony.conf
server ondemand
driftfile /var/lib/chrony/drift
makestep 1.0 -1
rtcsync
logdir /var/log/chrony
refclock PHC /dev/ptp_hyperv poll 3 dpoll -2 offset 0
EOF
chmod 644 /etc/chrony.conf

systemctl enable chronyd
systemctl start chronyd

0 comments on commit e25bb5a

Please sign in to comment.