updated vagrant default dir
This commit is contained in:
parent
0a1614b2f9
commit
8e7bef230d
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
HOSTNAME="`hostname -s`"
|
|
||||||
export RBACKUPDEST="s3+http://${HOSTNAME}.duplicitybackup"
|
|
||||||
source backup.command
|
|
|
@ -1,7 +1,21 @@
|
||||||
default: up
|
UPKGS := build-essential
|
||||||
|
|
||||||
up: destroy
|
default: login
|
||||||
|
|
||||||
|
login: up
|
||||||
|
vagrant ssh -c 'sudo envdir /etc/env su - root'
|
||||||
|
|
||||||
|
up:
|
||||||
vagrant up
|
vagrant up
|
||||||
|
|
||||||
destroy:
|
provision:
|
||||||
|
vagrant provision
|
||||||
|
|
||||||
|
clean:
|
||||||
vagrant destroy -f
|
vagrant destroy -f
|
||||||
|
rm -rf .vagrant
|
||||||
|
|
||||||
|
inside:
|
||||||
|
apt-get remove -y chef* puppet*
|
||||||
|
apt-get install -y $(UPKGS)
|
||||||
|
# DO STUFF HERE
|
||||||
|
|
|
@ -18,17 +18,58 @@ def get_internet_ifname()
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
SETUP_BASE = <<ENDPROVISION
|
||||||
# All Vagrant configuration is done here. The most common configuration
|
#!/bin/bash
|
||||||
# options are documented and commented below. For a complete reference,
|
|
||||||
# please see the online documentation at vagrantup.com.
|
|
||||||
|
|
||||||
# Every Vagrant virtual environment requires a box to build off of.
|
fallocate -l 10G /swapfile
|
||||||
|
mkswap /swapfile
|
||||||
|
swapon /swapfile
|
||||||
|
|
||||||
|
# first do updates
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
if [ -e /mirror/ ] ; then
|
||||||
|
cat > /etc/apt/sources.list <<EOF
|
||||||
|
deb file:///mirror/ trusty main restricted universe multiverse
|
||||||
|
deb file:///mirror/ trusty-updates main restricted universe multiverse
|
||||||
|
deb file:///mirror/ trusty-backports main restricted universe multiverse
|
||||||
|
deb file:///mirror/ trusty-security main restricted universe multiverse
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
cat > /etc/apt/sources.list <<EOF
|
||||||
|
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse
|
||||||
|
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse
|
||||||
|
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse
|
||||||
|
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
apt-get update
|
||||||
|
apt-get -y upgrade
|
||||||
|
apt-get -y install daemontools # the only thing that gets preinstalled
|
||||||
|
|
||||||
|
mkdir /etc/env
|
||||||
|
envdir /etc/env bash -l -c "cd /vagrant && make inside"
|
||||||
|
ENDPROVISION
|
||||||
|
|
||||||
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
config.vm.box = "trusty64"
|
config.vm.box = "trusty64"
|
||||||
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/" + \
|
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/" + \
|
||||||
"trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
|
"trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
|
||||||
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||||
|
|
||||||
|
if ENV['OSX_LOCAL_UBUNTU_MIRROR']
|
||||||
|
if File.exists? File.expand_path(ENV['OSX_LOCAL_UBUNTU_MIRROR'])
|
||||||
|
config.vm.synced_folder \
|
||||||
|
File.expand_path(ENV['OSX_LOCAL_UBUNTU_MIRROR']), \
|
||||||
|
"/mirror/", \
|
||||||
|
mount_options: [ 'ro' ]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if Vagrant.has_plugin?("vagrant-cachier")
|
||||||
|
config.cache.auto_detect = true
|
||||||
|
end
|
||||||
|
|
||||||
config.vm.synced_folder \
|
config.vm.synced_folder \
|
||||||
"~/Library/Caches/ubuntu-14.04-apt-archives/", \
|
"~/Library/Caches/ubuntu-14.04-apt-archives/", \
|
||||||
"/var/cache/apt/archives/", \
|
"/var/cache/apt/archives/", \
|
||||||
|
@ -38,8 +79,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
|
|
||||||
config.vm.provider "virtualbox" do |vb|
|
config.vm.provider "virtualbox" do |vb|
|
||||||
# vb.gui = true
|
# vb.gui = true
|
||||||
|
vb.customize ["modifyvm", :id, "--ioapic", "on"]
|
||||||
|
vb.customize ["modifyvm", :id, "--cpus", "8"]
|
||||||
vb.customize ["modifyvm", :id, "--memory", "4096"]
|
vb.customize ["modifyvm", :id, "--memory", "4096"]
|
||||||
end
|
end
|
||||||
|
|
||||||
config.vm.provision "shell", path: "init.sh"
|
# we need host key ssh for berkshelf fetching
|
||||||
|
# cookbooks from git private repos
|
||||||
|
config.ssh.forward_agent = true
|
||||||
|
|
||||||
|
config.vm.provision "shell", inline: SETUP_BASE
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
|
||||||
apt-get update
|
|
||||||
apt-get -y upgrade
|
|
||||||
cd /vagrant && make inside
|
|
Loading…
Reference in New Issue