]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/ntp/files/etc-default-ntp
sudo: replace debbits by publicity
[dsa-puppet.git] / modules / ntp / files / etc-default-ntp
1 ##
2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ##
4
5 #
6 # from the package:
7 #
8 NTPD_OPTS='-g'
9
10 rm -vf /var/lib/ntp/ntp.conf.dhcp
11
12 #
13 # make sure this host already has ntp keys:
14 #
15 h="`hostname`"
16 KEYSDIR="/etc/ntp.keys.d"
17 if ! [ -e "$KEYSDIR/ntpkey_cert_$h" ] ||
18    ! [ -e "$KEYSDIR/ntpkey_host_$h" ] ||
19    (! [ -e "$KEYSDIR/ntpkey_iff_$h" ] &&
20     ! [ -e "$KEYSDIR/ntpkey_iffkey_$h" ]); then
21         # on a "server" we would have to add -T to the ntp-keygen call
22         # and then run something like this:
23         #
24         ### sed -e 's/^[[:space:]]*#//' << 'EOF'
25         # cd "$KEYSDIR" &&
26         # RANDFILE=/dev/urandom /usr/sbin/ntp-keygen -T -I -H -c RSA-SHA1 -m 1024 &&
27         # RANDFILE=/dev/urandom ntp-keygen -q `hostname` -e | (
28         #        read l; echo "$l";
29         #        read l; echo "$l";
30         #        echo
31         #        echo "# This is the public version of this 'private' key -"
32         #        echo "# the private data has been replaced by 0x01."
33         #        echo "# (just ask 'openssl dsa -text < foo.pub')"
34         #        echo
35         #        openssl dsa -passin `hostname` -passin pass:`hostname` )  > ntpkey_iff_`hostname`.pub
36         #
37         #
38         # So that we can copy that .pub to all the clients that need it (don't
39         # call it .pub on the client then)
40         #
41         # on the client this is all we need:
42         if [ -x /usr/sbin/ntp-keygen ] ; then
43                 [ -d "$KEYSDIR" ] || install -d -o root -g ntp -m 770 "$KEYSDIR"
44                 ( cd "$KEYSDIR" && RANDFILE=/dev/urandom /usr/sbin/ntp-keygen -I -H -c RSA-SHA1 -m 1024 )
45         fi
46 fi