Skip to content

Instantly share code, notes, and snippets.

@rasschaert
Last active December 19, 2015 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasschaert/5947283 to your computer and use it in GitHub Desktop.
Save rasschaert/5947283 to your computer and use it in GitHub Desktop.
An example Vagrantfile with settings I often use.
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
###############################################################################
# Base box #
###############################################################################
config.vm.box = "chef/centos-6.5"
###############################################################################
# Global provisioning settings #
###############################################################################
config.vm.provision :puppet do |p|
p.module_path = "modules"
p.manifests_path = "manifests"
p.manifest_file = "site.pp"
p.hiera_config_path = "hiera.yaml"
end
###############################################################################
# Global VirtualBox settings #
###############################################################################
config.vm.provider "virtualbox" do |v|
v.customize [
"modifyvm", :id,
"--memory", "1024",
"--cpus", "2",
"--groups", "/Vagrant"
]
end
###############################################################################
# VM definitions #
###############################################################################
# Web server
config.vm.define :web do |web|
web.vm.hostname = "web.vagrant.local"
web.vm.network :private_network, ip: "192.168.100.11"
web.vm.provider("virtualbox") { |v| v.name = "web" }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment