Skip to content

Instantly share code, notes, and snippets.

@pearkes
Created March 17, 2012 23:31
Show Gist options
  • Save pearkes/2066517 to your computer and use it in GitHub Desktop.
Save pearkes/2066517 to your computer and use it in GitHub Desktop.
Foreman-Ready Vagrant Box with Provisioner. Precise64 and Ruby 1.9.3.
#!/bin/bash
# Update apt
apt-get update
# Install packages we need:
#
# - python-setuptools: to easy_install pip
# - python-dev: development headers so we can compile python C extensions
# - libpq-dv: PostgreSQL client library headers so we can compile
# psycopg
# - libevent-dev: ?
# - git-core: So we can work with git!
# - curl: Useful debugging tool
# - pep8, pyflakes: Useful dev tools for Python
# - make: Everything needs make.
# - htop: Useful ops tool.
# - ruby1.9.3: Ruby 1.9!
apt-get install -y \
python-setuptools \
python-dev \
libpq-dev \
libevent-dev \
git-core \
curl \
pep8 \
pyflakes \
make \
htop \
ruby1.9.3
# Install pip because easy_install is just garbage
easy_install pip
## Foreman
gem install foreman --no-ri --no-rdoc
# DONE!
echo "
Provisioning Complete. CTRL+C if this shows for more than a few seconds...
"
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
# Assign this VM to a host-only network IP, allowing you to access it
# via the IP. Host-only networks can talk to the host machine as well as
# any other machines on the same network, but cannot be accessed (through this
# network interface) by any external networks.
config.vm.network :hostonly, "33.33.33.16"
# Provision
config.vm.provision :shell, :path => "provision.sh"
# Share an additional folder to the guest VM. The first argument is
# an identifier, the second is the path on the guest to mount the
# folder, and the third is the path on the host to the actual folder.
config.vm.share_folder "shared-site", "~/site/", ""
end
@philipsommer
Copy link

You saved my day, thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment