Shell script based provisioning for Vagrant machines
By the example of postfix.
Capturing config:
PACKAGE=postfix
apt-get install $PACKAGE
# now make your selections
debconf-get-selections | grep $PACKAGE >> $PACKAGE.debconf
apt-get purge $PACKAGE
Preconfiguration:
# in the provision script
PACKAGE=postfix
debconf-set-selections < `dirname $0`/$PACKAGE.debconf
apt-get install -y $PACKAGE