]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/ntp/files/etc-default-ntp
Merge branch 'master' of git+ssh://puppet.debian.org/srv/puppet.debian.org/git/dsa...
[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 #
11 # make sure this host already has ntp keys:
12 #
13 h="`hostname`"
14 KEYSDIR="/etc/ntp.keys.d"
15 if ! [ -e "$KEYSDIR/ntpkey_cert_$h" ] ||
16    ! [ -e "$KEYSDIR/ntpkey_host_$h" ] ||
17    (! [ -e "$KEYSDIR/ntpkey_iff_$h" ] &&
18     ! [ -e "$KEYSDIR/ntpkey_iffkey_$h" ]); then
19         # on a "server" we would have to add -T to the ntp-keygen call
20         # and then run something like this:
21         #
22         ### sed -e 's/^[[:space:]]*#//' << 'EOF'
23         # cd "$KEYSDIR" &&
24         # RANDFILE=/dev/urandom /usr/sbin/ntp-keygen -T -I -H -c RSA-SHA1 -m 1024 &&
25         # RANDFILE=/dev/urandom ntp-keygen -q `hostname` -e | (
26         #        read l; echo "$l";
27         #        read l; echo "$l";
28         #        echo
29         #        echo "# This is the public version of this 'private' key -"
30         #        echo "# the private data has been replaced by 0x01."
31         #        echo "# (just ask 'openssl dsa -text < foo.pub')"
32         #        echo
33         #        openssl dsa -passin `hostname` -passin pass:`hostname` )  > ntpkey_iff_`hostname`.pub
34         #
35         #
36         # So that we can copy that .pub to all the clients that need it (don't
37         # call it .pub on the client then)
38         #
39         # on the client this is all we need:
40         if [ -x /usr/sbin/ntp-keygen ] ; then
41                 [ -d "$KEYSDIR" ] || install -d -o root -g ntp -m 770 "$KEYSDIR"
42                 ( cd "$KEYSDIR" && RANDFILE=/dev/urandom /usr/sbin/ntp-keygen -I -H -c RSA-SHA1 -m 1024 )
43         fi
44 fi