debian: re-enable provisioning tools installation

This commit is contained in:
Virgil Dupras 2018-04-15 09:55:37 -04:00
parent bc8b070565
commit 054e462e0b
7 changed files with 26 additions and 131 deletions

View file

@ -1,7 +1,6 @@
#!/bin/bash
set -e
source /etc/profile
source /envdump
export VAGRANT_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key"

View file

@ -7,11 +7,11 @@ utils.lxc.attach() {
}
utils.lxc.pipetofile() {
log "Sending piped content inside '${CONTAINER}' at $1 ..."
lxc-attach -n ${CONTAINER} -- /bin/bash -c "tee $1 > /dev/null" &>> ${LOG}
}
utils.lxc.runscript() {
log "Running $1 inside '${CONTAINER}'..."
cat $1 | utils.lxc.pipetofile /script.sh
utils.lxc.attach /bin/bash /script.sh
}

3
debian/clean.sh vendored
View file

@ -1,9 +1,10 @@
#!/bin/bash
set -e
source /etc/profile
echo "Cleaning up"
rm /envdump /script.sh
rm /script.sh
echo 'Removing temporary files...'
rm -rf /tmp/*

View file

@ -1,7 +0,0 @@
#!/bin/bash
ANSIBLE_VERSION=${ANSIBLE_VERSION:-latest}
apt-get install -y build-essential python-setuptools python-jinja2 python-yaml python-paramiko python-httplib2 python-crypto sshpass
wget https://releases.ansible.com/ansible/ansible-$ANSIBLE_VERSION.tar.gz -O /tmp//ansible.tar.gz
tar -zxvf /tmp/ansible.tar.gz -C /tmp/ && rm -r /tmp/ansible.tar.gz
cd /tmp/ansible-* && make && make install

View file

@ -2,7 +2,6 @@
set -e
source /etc/profile
source /envdump
echo 'Installing extra packages and upgrading'
@ -14,131 +13,36 @@ PACKAGES+=" ${ADDPACKAGES}"
if [ $DISTRIBUTION = 'ubuntu' ]; then
PACKAGES+=' software-properties-common'
fi
ANSIBLE=${ANSIBLE:-0}
if [[ $ANSIBLE = 1 ]]; then
PACKAGES+=' ansible'
fi
CHEF=${CHEF:-0}
if [[ $CHEF = 1 ]]; then
PACKAGES+=' chef'
fi
PUPPET=${PUPPET:-0}
if [[ $PUPPET = 1 ]]; then
PACKAGES+=' puppet'
fi
SALT=${SALT:-0}
if [[ $SALT = 1 ]]; then
PACKAGES+=' salt-minion'
fi
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
apt-get update
apt-get install ${PACKAGES[*]} -y --force-yes
apt-get upgrade -y --force-yes
ANSIBLE=${ANSIBLE:-0}
CHEF=${CHEF:-0}
PUPPET=${PUPPET:-0}
SALT=${SALT:-0}
BABUSHKA=${BABUSHKA:-0}
if [ $DISTRIBUTION = 'debian' ]; then
# Enable bash-completion
sed -e '/^#if ! shopt -oq posix; then/,/^#fi/ s/^#\(.*\)/\1/g' \
-i /etc/bash.bashrc
fi
#if [ $ANSIBLE = 1 ]; then
# if $(lxc-attach -n ${CONTAINER} -- which ansible &>/dev/null); then
# log "Ansible has been installed on container, skipping"
# else
# info "Installing Ansible"
# cp debian/install-ansible.sh ${ROOTFS}/tmp/ && chmod +x ${ROOTFS}/tmp/install-ansible.sh
# utils.lxc.attach /tmp/install-ansible.sh &>>${LOG}
# fi
#else
# log "Skipping Ansible installation"
#fi
#if [ $CHEF = 1 ]; then
# if $(lxc-attach -n ${CONTAINER} -- which chef-solo &>/dev/null); then
# log "Chef has been installed on container, skipping"
# else
# 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
# utils.lxc.attach /tmp/install-chef.sh
# fi
#else
# log "Skipping Chef installation"
#fi
#if [ $PUPPET = 1 ]; then
# if $(lxc-attach -n ${CONTAINER} -- which puppet &>/dev/null); then
# log "Puppet has been installed on container, skipping"
# elif [ ${RELEASE} = 'sid' ]; then
# warn "Puppet can't be installed on Debian sid, skipping"
# else
# log "Installing Puppet"
# wget http://apt.puppetlabs.com/puppetlabs-release-${RELEASE}.deb -O "${ROOTFS}/tmp/puppetlabs-release-stable.deb" &>>${LOG}
# utils.lxc.attach dpkg -i "/tmp/puppetlabs-release-stable.deb"
# utils.lxc.attach apt-get update
# utils.lxc.attach apt-get install puppet -y --force-yes
# fi
#else
# log "Skipping Puppet installation"
#fi
#if [ $SALT = 1 ]; then
# if $(lxc-attach -n ${CONTAINER} -- which salt-minion &>/dev/null); then
# log "Salt has been installed on container, skipping"
# elif [ ${RELEASE} = 'raring' ]; then
# warn "Salt can't be installed on Ubuntu Raring 13.04, skipping"
# else
# if [ $DISTRIBUTION = 'ubuntu' ]; then
# if [ $RELEASE = 'precise' ] || [ $RELEASE = 'trusty' ] || [ $RELEASE = 'xenial' ] ; then
# # For LTS releases we use packages from repo.saltstack.com
# if [ $RELEASE = 'precise' ]; then
# SALT_SOURCE_1="deb http://repo.saltstack.com/apt/ubuntu/12.04/amd64/latest precise main"
# SALT_GPG_KEY="https://repo.saltstack.com/apt/ubuntu/12.04/amd64/latest/SALTSTACK-GPG-KEY.pub"
# elif [ $RELEASE = 'trusty' ]; then
# SALT_SOURCE_1="deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest trusty main"
# SALT_GPG_KEY="https://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest/SALTSTACK-GPG-KEY.pub"
# elif [ $RELEASE = 'xenial' ]; then
# SALT_SOURCE_1="deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest xenial main"
# SALT_GPG_KEY="https://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest/SALTSTACK-GPG-KEY.pub"
# fi
# echo $SALT_SOURCE_1 > ${ROOTFS}/etc/apt/sources.list.d/saltstack.list
# utils.lxc.attach wget -q -O /tmp/salt.key $SALT_GPG_KEY
# utils.lxc.attach apt-key add /tmp/salt.key
# elif [ $RELEASE = 'quantal' ] || [ $RELEASE = 'saucy' ] ; then
# utils.lxc.attach add-apt-repository -y ppa:saltstack/salt
# fi
# # For Utopic, Vivid and Wily releases use system packages
# else # DEBIAN
# if [ $RELEASE == "squeeze" ]; then
# SALT_SOURCE_1="deb http://debian.saltstack.com/debian squeeze-saltstack main"
# SALT_SOURCE_2="deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free"
# elif [ $RELEASE == "wheezy" ]; then
# SALT_SOURCE_1="deb http://repo.saltstack.com/apt/debian/7/amd64/latest wheezy main"
# elif [ $RELEASE == "jessie" ]; then
# SALT_SOURCE_1="deb http://repo.saltstack.com/apt/debian/8/amd64/latest jessie main"
# else
# SALT_SOURCE_1="deb http://debian.saltstack.com/debian unstable main"
# fi
# echo $SALT_SOURCE_1 > ${ROOTFS}/etc/apt/sources.list.d/saltstack.list
# echo $SALT_SOURCE_2 >> ${ROOTFS}/etc/apt/sources.list.d/saltstack.list
# utils.lxc.attach wget -q -O /tmp/salt.key "https://repo.saltstack.com/apt/debian/8/amd64/latest/SALTSTACK-GPG-KEY.pub"
# utils.lxc.attach apt-key add /tmp/salt.key
# fi
# utils.lxc.attach apt-get update
# utils.lxc.attach apt-get install salt-minion -y --force-yes
# fi
#else
# log "Skipping Salt installation"
#fi
#if [ $BABUSHKA = 1 ]; then
# if $(lxc-attach -n ${CONTAINER} -- which babushka &>/dev/null); then
# log "Babushka has been installed on container, skipping"
# elif [ ${RELEASE} = 'trusty' ]; then
# warn "Babushka can't be installed on Ubuntu Trusty 14.04, skipping"
# else
# 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
# utils.lxc.attach /tmp/install-babushka.sh
# fi
#else
# log "Skipping Babushka installation"
#fi

View file

@ -1,7 +1,6 @@
#!/bin/bash
set -e
source /etc/profile
source /envdump
# Fixes some networking issues
# See https://github.com/fgrehm/vagrant-lxc/issues/91 for more info

View file

@ -39,7 +39,6 @@ SECS=15
log "Sleeping for $SECS seconds..."
sleep $SECS
printenv | grep "^\(DISTRIBUTION\|RELEASE\|CONTAINER\|LANG\)=" | utils.lxc.pipetofile /envdump
utils.lxc.runscript debian/vagrant-lxc-fixes.sh
utils.lxc.runscript debian/install-extras.sh
utils.lxc.runscript common/prepare-vagrant-user.sh