Sha256: b795b3afbd1d2536d41cedbdae97a91954b82ca5608fb67c3309f195b23eb5be

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

Contents

# postinstall.sh based upon Mitchell's old basebox example

# mark the build time
date > /etc/vagrant_box_build_time

# update the apt cache and packages
case $(lsb_release -cs) in
    'precise')
        apt-get clean
        rm -rf /var/lib/apt/lists/*
        apt-get clean
    ;;
    *)
    ;;
esac

apt-get -qy update
apt-get -qy upgrade

# install some oft used packages
apt-get -qy install linux-headers-$(uname -r) build-essential \
  zlib1g-dev libssl-dev

# configure password-less sudo
usermod -a -G sudo vagrant
echo "%vagrant ALL=NOPASSWD:ALL" > /tmp/vagrant
mv /tmp/vagrant /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant

# install the vagrant-provided ssh keys
mkdir -pm 700 /home/vagrant/.ssh
curl -Lo /home/vagrant/.ssh/authorized_keys \
  'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub'
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh

# under systemd distributions, networking breaks on first reboot
# this is because it's renamed to follow the PCI slot
case $(lsb_release -cs) in
    "wily" | "xenial" | "stretch")
        sed -i "s/ens33/ens32/g" /etc/network/interfaces
    ;;
    *)
    ;;
esac

# clean up any artifacts
rm -f /home/vagrant/shutdown.sh

exit

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
boxes-3.3.1 scripts/postinstall.sh
boxes-3.3.0 scripts/postinstall.sh
boxes-3.2.0 scripts/postinstall.sh
boxes-3.1.0 scripts/postinstall.sh
boxes-3.0.0 scripts/postinstall.sh