From 1b8fb6137b4eabc1b0309b31efacccd26ce6e0bf Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sun, 9 Mar 2014 04:38:36 -0300 Subject: [PATCH] Bring back support for installing provisioners on ubuntu base boxes --- boxes/debian/install-extras.sh | 48 +++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/boxes/debian/install-extras.sh b/boxes/debian/install-extras.sh index 875bde6..a489c46 100755 --- a/boxes/debian/install-extras.sh +++ b/boxes/debian/install-extras.sh @@ -15,4 +15,50 @@ lxc-attach -n ${CONTAINER} -- apt-get update lxc-attach -n ${CONTAINER} -- apt-get install ${UBUNTU_PACKAGES[*]} -y --force-yes lxc-attach -n ${CONTAINER} -- apt-get upgrade -y --force-yes -warn 'TODO: Install provisioners' +CHEF=${CHEF:-0} +PUPPET=${PUPPET:-0} +SALT=${SALT:-0} +BABUSHKA=${BABUSHKA:-0} + +if [ $CHEF = 1 ]; then + # TODO: Check if Chef has been installed + log "Installing Chef" + cat > ${ROOTFS}/tmp/install-chef.sh << EOF +#!/bin/sh +curl -L https://www.opscode.com/chef/install.sh -k | sudo bash +EOF + chmod +x ${ROOTFS}/tmp/install-chef.sh + lxc-attach -n ${CONTAINER} -- /tmp/install-chef.sh +else + log "Skipping Chef installation" +fi + +if [ $PUPPET = 1 ]; then + log "Installing Puppet" + wget http://apt.puppetlabs.com/puppetlabs-release-stable.deb -O "${ROOTFS}/tmp/puppetlabs-release-stable.deb" + lxc-attach -n ${CONTAINER} -- dpkg -i "/tmp/puppetlabs-release-stable.deb" + lxc-attach -n ${CONTAINER} -- apt-get update + lxc-attach -n ${CONTAINER} -- apt-get install puppet -y --force-yes +else + log "Skipping Puppet installation" +fi + +if [ $SALT = 1 ]; then + lxc-attach -n ${CONTAINER} -- apt-add-repository -y ppa:saltstack/salt + lxc-attach -n ${CONTAINER} -- apt-get update + lxc-attach -n ${CONTAINER} -- apt-get install salt-minion -y --force-yes +else + log "Skipping Salt installation" +fi + +if [ $BABUSHKA = 1 ]; then + log "Installing Babushka" + cat > $ROOTFS/tmp/install-babushka.sh << EOF +#!/bin/sh +curl https://babushka.me/up | sudo bash +EOF + chmod +x $ROOTFS/tmp/install-babushka.sh + lxc-attach -n ${CONTAINER} -- /tmp/install-babushka.sh +else + log "Skipping Babushka installation" +fi