-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathntp-pools.ks.in
50 lines (40 loc) · 1.29 KB
/
ntp-pools.ks.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#version=DEVEL
%ksappend repos/default.ks
network --bootproto=dhcp
# use ntp.cesnet.cz as an NTP server and 0.pool.ntp.org as an NTP pool
timezone --utc Europe/Prague
timesource --ntp-server ntp.cesnet.cz
timesource --ntp-server nts-test.strangled.net --nts
timesource --ntp-pool 0.pool.ntp.org
bootloader --timeout=1
zerombr
clearpart --all --initlabel
autopart
keyboard us
lang en_US.UTF-8
rootpw testcase
shutdown
%ksappend payload/default_packages.ks
%post
cat /etc/chrony.conf
egrep '^\s*server\s*ntp\.cesnet\.cz\s*iburst\s*$' /etc/chrony.conf
if [ $? -ne 0 ]; then
echo '*** ntp.cesnet.cz not configured as an NTP server' >> /root/RESULT
fi
egrep '^\s*server\s*nts\-test\.strangled\.net\s*iburst\s*nts\s*$' /etc/chrony.conf
if [ $? -ne 0 ]; then
echo '*** nts-test.strangled.net not configured as an NTP server' >> /root/RESULT
fi
egrep '^\s*pool\s*0\.pool\.ntp\.org\s*iburst\s*$' /etc/chrony.conf
if [ $? -ne 0 ]; then
echo '*** 0.pool.ntp.org not configured as an NTP pool' >> /root/RESULT
fi
# Check that the chronyd service is enabled
systemctl list-unit-files --type service --state enabled | egrep -q "chronyd.service"
if [[ $? -ne 0 ]]; then
echo "*** Failed check: chronyd.service is enabled" >> /root/RESULT
fi
if [ ! -e /root/RESULT ]; then
echo SUCCESS > /root/RESULT
fi
%end