Skip to content

Commit e07e720

Browse files
committed
CI Use dedicated NTP servers
Failed job https://github.com/ScaleComputing/HyperCoreAnsibleCollection/actions/runs/4625947983/jobs/8182201867#step:8:120 Hopefully this will lessen load on pool.ntp.org, so we can continue to use it when not testing. Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
1 parent cb8507e commit e07e720

File tree

5 files changed

+75
-5
lines changed

5 files changed

+75
-5
lines changed

ci-infra/ntp-chrony/Readme.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
We need a reliable 2 NTP servers for testing NTP reconfiguration.
2+
3+
Setup them once in VMs
4+
5+
```
6+
apt install -y chrony ntpdate
7+
cat /etc/chrony/chrony.conf
8+
# See chrony.conf example file.
9+
# Just add 'allow all' line if needed
10+
grep 'allow all' /etc/chrony/chrony.conf || echo 'allow all'
11+
12+
systemctl enable chrony
13+
systemctl restart chrony
14+
chronyc tracking
15+
16+
ntpdate -qup1 localhost
17+
```
18+
19+
Check from outside if firewall allows NTP traffic - port 123/UDP.

ci-infra/ntp-chrony/chrony.conf

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Welcome to the chrony configuration file. See chrony.conf(5) for more
2+
# information about usuable directives.
3+
4+
# This will use (up to):
5+
# - 4 sources from ntp.ubuntu.com which some are ipv6 enabled
6+
# - 2 sources from 2.ubuntu.pool.ntp.org which is ipv6 enabled as well
7+
# - 1 source from [01].ubuntu.pool.ntp.org each (ipv4 only atm)
8+
# This means by default, up to 6 dual-stack and up to 2 additional IPv4-only
9+
# sources will be used.
10+
# At the same time it retains some protection against one of the entries being
11+
# down (compare to just using one of the lines). See (LP: #1754358) for the
12+
# discussion.
13+
#
14+
# About using servers from the NTP Pool Project in general see (LP: #104525).
15+
# Approved by Ubuntu Technical Board on 2011-02-08.
16+
# See http://www.pool.ntp.org/join.html for more information.
17+
pool ntp.ubuntu.com iburst maxsources 4
18+
pool 0.ubuntu.pool.ntp.org iburst maxsources 1
19+
pool 1.ubuntu.pool.ntp.org iburst maxsources 1
20+
pool 2.ubuntu.pool.ntp.org iburst maxsources 2
21+
22+
# This directive specify the location of the file containing ID/key pairs for
23+
# NTP authentication.
24+
keyfile /etc/chrony/chrony.keys
25+
26+
# This directive specify the file into which chronyd will store the rate
27+
# information.
28+
driftfile /var/lib/chrony/chrony.drift
29+
30+
# Uncomment the following line to turn logging on.
31+
#log tracking measurements statistics
32+
33+
# Log files location.
34+
logdir /var/log/chrony
35+
36+
# Stop bad estimates upsetting machine clock.
37+
maxupdateskew 100.0
38+
39+
# This directive enables kernel synchronisation (every 11 minutes) of the
40+
# real-time clock. Note that it can't be used along with the 'rtcfile' directive.
41+
rtcsync
42+
43+
# Step the system clock instead of slewing it if the adjustment is larger than
44+
# one second, but only in the first three clock updates.
45+
makestep 1 3
46+
47+
allow all

tests/integration/targets/role_cluster_config/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# certificate: plain_text_from_x509
3030
config_url: https://login.microsoftonline.com/76d4c62a-a9ca-4dc2-9187-e2cc4d9abe7f/v2.0/.well-known/openid-configuration
3131
scopes: openid+profile
32-
time_server: 2.pool.ntp.org
32+
time_server: 10.5.11.5
3333
time_zone: Europe/Ljubljana
3434
smtp:
3535
server: mail_a.example.com
@@ -71,7 +71,7 @@
7171
# certificate: plain_text_from_x509
7272
config_url: https://login.microsoftonline.com/76d4c62a-a9ca-4dc2-9187-e2cc4d9abe7f/v2.0/.well-known/openid-configuration
7373
scopes: openid+profile
74-
time_server: 3.pool.ntp.org
74+
time_server: 10.5.11.7
7575
time_zone: Europe/Zagreb
7676
smtp:
7777
server: mail_b.example.com

tests/integration/targets/time_server/tasks/01_time_server_info.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
vars:
88
actual_uuid: "timesource_guid"
9-
actual_host: "3.pool.ntp.org"
9+
# We need 2 NTP servers.
10+
# Set them up per ci-infra/ntp-chrony/Readme.md.
11+
actual_host: "10.5.11.5"
1012

1113
block:
1214
# -------------------------------------------------------

tests/integration/targets/time_server/tasks/02_time_server.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
SC_PASSWORD: "{{ sc_config[sc_host].sc_password }}"
66
SC_TIMEOUT: "{{ sc_timeout * 10 }}"
77
vars:
8-
time_server_a: 2.pool.ntp.org
9-
time_server_b: 3.pool.ntp.org
8+
# We need 2 NTP servers.
9+
# Set them up per ci-infra/ntp-chrony/Readme.md.
10+
time_server_a: 10.5.11.5
11+
time_server_b: 10.5.11.7
1012
actual_uuid: timesource_guid
1113

1214
block:

0 commit comments

Comments
 (0)