boxes: Improve CM handling

This commit is contained in:
Fabio Rehm 2014-03-09 17:55:00 -03:00
parent 7effe1f092
commit e69441a99b

View file

@ -58,21 +58,31 @@ else
fi fi
if [ $SALT = 1 ]; then if [ $SALT = 1 ]; then
lxc-attach -n ${CONTAINER} -- apt-add-repository -y ppa:saltstack/salt if $(lxc-attach -n ${CONTAINER} -- which salt-minion &>/dev/null); then
lxc-attach -n ${CONTAINER} -- apt-get update log "Salt has been installed on container, skipping"
lxc-attach -n ${CONTAINER} -- apt-get install salt-minion -y --force-yes elif [ ${RELEASE} = 'raring' ]; then
warn "Salt can't be installed on Ubuntu Raring 13.04, skipping"
else
lxc-attach -n ${CONTAINER} -- apt-add-repository -y ppa:saltstack/salt
lxc-attach -n ${CONTAINER} -- apt-get update
chroot ${ROOTFS} apt-get install salt-minion -y --force-yes
fi
else else
log "Skipping Salt installation" log "Skipping Salt installation"
fi fi
if [ $BABUSHKA = 1 ]; then if [ $BABUSHKA = 1 ]; then
log "Installing Babushka" if $(lxc-attach -n ${CONTAINER} -- which babushka &>/dev/null); then
cat > $ROOTFS/tmp/install-babushka.sh << EOF log "Babushka has been installed on container, skipping"
else
log "Installing Babushka"
cat > $ROOTFS/tmp/install-babushka.sh << EOF
#!/bin/sh #!/bin/sh
curl https://babushka.me/up | sudo bash curl https://babushka.me/up | sudo bash
EOF EOF
chmod +x $ROOTFS/tmp/install-babushka.sh chmod +x $ROOTFS/tmp/install-babushka.sh
lxc-attach -n ${CONTAINER} -- /tmp/install-babushka.sh lxc-attach -n ${CONTAINER} -- /tmp/install-babushka.sh
fi
else else
log "Skipping Babushka installation" log "Skipping Babushka installation"
fi fi