#!/bin/sh set -e #template for diversions ORIG_PUPPETCONF_FILE="/etc/puppet/puppet.conf" OUR_PUPPETCONF_FILE="/etc/lliurex-puppet/puppet.conf" ORIG_AUTHCONF_FILE="/etc/puppet/auth.conf" OUR_AUTHCONF_FILE="/etc/lliurex-puppet/auth.conf" ORIG_DEFAULTPUPPET_FILE="/etc/default/puppet" OUR_DEFAULTPUPPET_FILE="/etc/lliurex-puppet/puppet" OUR_PACKAGE="lliurex-puppet" case $1 in configure) echo " * [ Lliurex Puppet ] : divert puppet.conf " if dpkg-divert --package ${OUR_PACKAGE} --add --rename --divert ${ORIG_PUPPETCONF_FILE}.real ${ORIG_PUPPETCONF_FILE} ; then ln -fs ${OUR_PUPPETCONF_FILE} ${ORIG_PUPPETCONF_FILE} else echo "Unable to divert file ${ORIG_PUPPETCONF_FILE}" fi # echo " * [ Lliurex Puppet ] : divert auth.conf " # if dpkg-divert --package ${OUR_PACKAGE} --add --rename --divert ${ORIG_AUTHCONF_FILE}.real ${ORIG_AUTHCONF_FILE} ; then # ln -fs ${OUR_AUTHCONF_FILE} ${ORIG_AUTHCONF_FILE} # else # echo "Unable to divert file ${ORIG_AUTHCONF_FILE}" # fi echo " * [ Lliurex Puppet ] : divert /etc/default/puppet " if dpkg-divert --package ${OUR_PACKAGE} --add --rename --divert ${ORIG_DEFAULTPUPPET_FILE}.real ${ORIG_DEFAULTPUPPET_FILE} ; then ln -fs ${OUR_DEFAULTPUPPET_FILE} ${ORIG_DEFAULTPUPPET_FILE} else echo "Unable to divert file ${ORIG_DEFAULTPUPPET_FILE}" fi puppet agent start || true puppet cert generate $(hostname) || true #puppet agent --test || true ;; *) echo "Nothing to do" ;; esac # Other Stuff # #DEBHELPER#