Skip to content

Instantly share code, notes, and snippets.

@hugovk
Created June 1, 2015 07:39
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 hugovk/bf1688ceb63c1d6ab1d1 to your computer and use it in GitHub Desktop.
Save hugovk/bf1688ceb63c1d6ab1d1 to your computer and use it in GitHub Desktop.
A Drupal Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
hostname = 'myvagrant'
domain = 'example.com'
ip = '192.168.54.5'
#forwarded_port = 8080
cpus = 2
ram = 2048
Vagrant.configure("2") do |config|
# Provider: VirtualBox (default)
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
# Provider: VMWare Workstation
config.vm.provider :vmware_workstation do |v,o|
o.vm.box = "precise64_vmware"
o.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
v.vmx["memsize"] = ram
v.vmx["numvcpus"] = cpus
end
config.vm.provider "virtualbox" do |v,o|
v.customize [
'modifyvm', :id,
'--name', hostname,
'--cpus', cpus,
'--memory', ram
]
end
# Common settings
config.vm.host_name = (domain) ? hostname + '.' + domain : hostname
# config.vm.network "forwarded_port", guest: 80, host: forwarded_port
config.ssh.forward_agent = true
if ip
if ip == 'dhcp'
config.vm.network :private_network, type: :dhcp
else
config.vm.network :private_network, ip: ip
end
else
config.vm.network :public_network
end
# Puppet provision
config.vm.provision :puppet do |puppet|
puppet.manifests_path = 'puppet/manifests'
puppet.manifest_file = 'site.pp'
puppet.module_path = 'puppet/modules'
end
end
@hugovk
Copy link
Author

hugovk commented Jun 1, 2015

Also needs a load of files in a puppet directory, ask me for them.

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