debian: re-enable provisioning tools installation
This commit is contained in:
parent
bc8b070565
commit
054e462e0b
7 changed files with 26 additions and 131 deletions
|
@ -1,7 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
source /envdump
|
|
||||||
|
|
||||||
export VAGRANT_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key"
|
export VAGRANT_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key"
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,11 @@ utils.lxc.attach() {
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.lxc.pipetofile() {
|
utils.lxc.pipetofile() {
|
||||||
log "Sending piped content inside '${CONTAINER}' at $1 ..."
|
|
||||||
lxc-attach -n ${CONTAINER} -- /bin/bash -c "tee $1 > /dev/null" &>> ${LOG}
|
lxc-attach -n ${CONTAINER} -- /bin/bash -c "tee $1 > /dev/null" &>> ${LOG}
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.lxc.runscript() {
|
utils.lxc.runscript() {
|
||||||
|
log "Running $1 inside '${CONTAINER}'..."
|
||||||
cat $1 | utils.lxc.pipetofile /script.sh
|
cat $1 | utils.lxc.pipetofile /script.sh
|
||||||
utils.lxc.attach /bin/bash /script.sh
|
utils.lxc.attach /bin/bash /script.sh
|
||||||
}
|
}
|
||||||
|
|
3
debian/clean.sh
vendored
3
debian/clean.sh
vendored
|
@ -1,9 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
source /etc/profile
|
||||||
|
|
||||||
echo "Cleaning up"
|
echo "Cleaning up"
|
||||||
|
|
||||||
rm /envdump /script.sh
|
rm /script.sh
|
||||||
|
|
||||||
echo 'Removing temporary files...'
|
echo 'Removing temporary files...'
|
||||||
rm -rf /tmp/*
|
rm -rf /tmp/*
|
||||||
|
|
7
debian/install-ansible.sh
vendored
7
debian/install-ansible.sh
vendored
|
@ -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
|
|
142
debian/install-extras.sh
vendored
142
debian/install-extras.sh
vendored
|
@ -2,7 +2,6 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
source /envdump
|
|
||||||
|
|
||||||
echo 'Installing extra packages and upgrading'
|
echo 'Installing extra packages and upgrading'
|
||||||
|
|
||||||
|
@ -14,131 +13,36 @@ PACKAGES+=" ${ADDPACKAGES}"
|
||||||
if [ $DISTRIBUTION = 'ubuntu' ]; then
|
if [ $DISTRIBUTION = 'ubuntu' ]; then
|
||||||
PACKAGES+=' software-properties-common'
|
PACKAGES+=' software-properties-common'
|
||||||
fi
|
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 update
|
||||||
apt-get install ${PACKAGES[*]} -y --force-yes
|
apt-get install ${PACKAGES[*]} -y --force-yes
|
||||||
apt-get upgrade -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
|
if [ $DISTRIBUTION = 'debian' ]; then
|
||||||
# Enable bash-completion
|
# Enable bash-completion
|
||||||
sed -e '/^#if ! shopt -oq posix; then/,/^#fi/ s/^#\(.*\)/\1/g' \
|
sed -e '/^#if ! shopt -oq posix; then/,/^#fi/ s/^#\(.*\)/\1/g' \
|
||||||
-i /etc/bash.bashrc
|
-i /etc/bash.bashrc
|
||||||
fi
|
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
|
|
||||||
|
|
1
debian/vagrant-lxc-fixes.sh
vendored
1
debian/vagrant-lxc-fixes.sh
vendored
|
@ -1,7 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
source /envdump
|
|
||||||
|
|
||||||
# Fixes some networking issues
|
# Fixes some networking issues
|
||||||
# See https://github.com/fgrehm/vagrant-lxc/issues/91 for more info
|
# See https://github.com/fgrehm/vagrant-lxc/issues/91 for more info
|
||||||
|
|
|
@ -39,7 +39,6 @@ SECS=15
|
||||||
log "Sleeping for $SECS seconds..."
|
log "Sleeping for $SECS seconds..."
|
||||||
sleep $SECS
|
sleep $SECS
|
||||||
|
|
||||||
printenv | grep "^\(DISTRIBUTION\|RELEASE\|CONTAINER\|LANG\)=" | utils.lxc.pipetofile /envdump
|
|
||||||
utils.lxc.runscript debian/vagrant-lxc-fixes.sh
|
utils.lxc.runscript debian/vagrant-lxc-fixes.sh
|
||||||
utils.lxc.runscript debian/install-extras.sh
|
utils.lxc.runscript debian/install-extras.sh
|
||||||
utils.lxc.runscript common/prepare-vagrant-user.sh
|
utils.lxc.runscript common/prepare-vagrant-user.sh
|
||||||
|
|
Loading…
Reference in a new issue