Add support for puppet deployment

Booting with Debian installation and bootoption puppet=192.168.51.25
sets up the host for puppet node deployment.

From: Michael Prokop <mprokop@sipwise.com>
ksolomko/vlan
Michael Prokop 13 years ago
parent 71e070fae8
commit ed48a9c203

@ -27,6 +27,7 @@ TARGET=/mnt
PRO_EDITION=false
CE_EDITION=false
NGCP_INSTALLER=false
PUPPET=''
INTERACTIVE=false
LOCAL_MIRROR=false
DHCP=false
@ -160,6 +161,11 @@ if "$PRO_EDITION" ; then
fi
fi
if checkBootParam "puppet" ; then
# we expected to get the IP address of the puppet server
PUPPET=$(getBootParam puppet)
fi
# test unfinished releases against
# "http://deb.sipwise.com/autobuild/ release-$AUTOBUILD_RELEASE"
if checkBootParam ngcpautobuildrelease ; then
@ -660,6 +666,14 @@ acpi acpid acpi-support-base
EOF
fi
if [ -n "$PUPPET" ] ; then
cat >> /etc/debootstrap/packages << EOF
# for interal use at sipwise
openssh-server
puppet
EOF
fi
# provide Debian mirror
if [ -d /srv/mirror/debian ] && $USE_LOCAL_MIRROR ; then
echo "Directory /srv/mirror/debian found, trying to use local mirror."
@ -1138,6 +1152,17 @@ else
EOF
fi
if [ -n "$PUPPET" ] ; then
cat >> $TARGET/etc/hosts << EOF
# puppet server
$PUPPET puppet.sipwise.com puppet
EOF
chroot $TARGET sed -i 's/START=.*/START=yes/' /etc/default/puppet
echo "server=puppet.sipwise.com" >> ${TARGET}/etc/puppet/puppet.conf
echo "certname=$TARGET_HOSTNAME" >> ${TARGET}/etc/puppet/puppet.conf
fi
# make sure we don't leave any running processes
for i in asterisk collectd collectdmon exim4 \
glusterfs glusterfsd haveged redis-server \

Loading…
Cancel
Save