From 524cd752df776a729a6e835ad9cf20262c670d69 Mon Sep 17 00:00:00 2001 From: Paul Edwards Date: Thu, 24 Jun 2021 18:23:31 +0100 Subject: [PATCH 1/5] added chrony setup --- playbooks/chrony.yml | 50 +++++++++++++++++++ .../cluster-init/scripts/7-chronyd.sh | 14 ++++++ 2 files changed, 64 insertions(+) create mode 100644 playbooks/chrony.yml create mode 100755 playbooks/roles/cyclecloud_pbs/cluster-init/scripts/7-chronyd.sh diff --git a/playbooks/chrony.yml b/playbooks/chrony.yml new file mode 100644 index 000000000..593e4abff --- /dev/null +++ b/playbooks/chrony.yml @@ -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, ondemand, 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 + diff --git a/playbooks/roles/cyclecloud_pbs/cluster-init/scripts/7-chronyd.sh b/playbooks/roles/cyclecloud_pbs/cluster-init/scripts/7-chronyd.sh new file mode 100755 index 000000000..8c4c445a7 --- /dev/null +++ b/playbooks/roles/cyclecloud_pbs/cluster-init/scripts/7-chronyd.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +cat </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 \ No newline at end of file From cbdd6a51acf19d4c10d8adebb97baf39eaba4a0f Mon Sep 17 00:00:00 2001 From: Paul Edwards Date: Thu, 24 Jun 2021 18:26:58 +0100 Subject: [PATCH 2/5] Added yml to install --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 189b24869..34e47d80b 100755 --- a/install.sh +++ b/install.sh @@ -17,7 +17,8 @@ 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 From dfc0324bf1dbb57a9da5dc423773b010e24092e0 Mon Sep 17 00:00:00 2001 From: Paul Edwards Date: Thu, 24 Jun 2021 18:29:17 +0100 Subject: [PATCH 3/5] was overwriting ondemand config --- playbooks/chrony.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/chrony.yml b/playbooks/chrony.yml index 593e4abff..f39451c41 100644 --- a/playbooks/chrony.yml +++ b/playbooks/chrony.yml @@ -25,7 +25,7 @@ enabled: yes state: started -- hosts: jumpbox, scheduler, ondemand, ccportal, lustre, lustre-oss-*, robinhood +- hosts: jumpbox, scheduler, ccportal, lustre, lustre-oss-*, robinhood become: true vars_files: - '{{global_config_file}}' From 7587a8bebd5d71164cca8eb1b2cb56a584dd5f20 Mon Sep 17 00:00:00 2001 From: Xavier Pillons Date: Fri, 25 Jun 2021 10:33:15 +0000 Subject: [PATCH 4/5] add chrony option --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 34e47d80b..c27c2ef32 100755 --- a/install.sh +++ b/install.sh @@ -24,7 +24,7 @@ case $TARGET in 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) From 26c66ac1cc967b4fcc06e13ec80baf4f92e9abdc Mon Sep 17 00:00:00 2001 From: Xavier Pillons Date: Fri, 25 Jun 2021 10:35:34 +0000 Subject: [PATCH 5/5] add chrony in the pipeline --- .github/workflows/integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 822bc9eae..b048d9f0c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -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