Skip to content

Instantly share code, notes, and snippets.

@parnurzeal
Forked from loadx/gist:2934332
Created April 9, 2014 08:15
Show Gist options
  • Save parnurzeal/10240188 to your computer and use it in GitHub Desktop.
Save parnurzeal/10240188 to your computer and use it in GitHub Desktop.
Vagrant::Config.run do |config|
# debug default is :headless
config.vm.boot_mode = "gui"
# the .box file
config.vm.box = "afa-chef-server"
config.vm.box_url = "/V3/base_debian/with-apt.box"
# ssh config
config.ssh.private_key_path = "afa_private_key"
config.ssh.username = "afavm"
config.vm.define :chef_server do |chef_server_config|
# networking options
chef_server_config.vm.network :hostonly, "10.11.12.13"
chef_server_config.vm.forward_port 22, 2222 # ssh
chef_server_config.vm.forward_port 80, 8080 # reprepro, apache
chef_server_config.vm.forward_port 4040, 4040 # chef-server
chef_server_config.vm.forward_port 4000, 4000 # chef-server
# commands to send to 'VBoxManage modifyvm' to override VirtualBox defaults
chef_server_config.vm.customize ["modifyvm", :id, "--memory", 512]
chef_server_config.vm.customize ["modifyvm", :id, "--name", "AFA-chef-server"]
chef_server_config.vm.customize ["modifyvm", :id, "--usb", "off"]
# chef cookbooks
chef_server_config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.log_level = :info
chef.add_recipe("test::disable_internet")
#chef.add_recipe("chef-server::register_client")
chef.add_recipe("apt")
chef.add_recipe("reprepro")
chef.add_recipe("chef-server")
end
end
config.vm.define :dev do |dev_server_config|
# networking options
dev_server_config.vm.network :hostonly, "10.11.12.14"
dev_server_config.vm.forward_port 22, 3222 # ssh
# commands to send to 'VBoxManage modifyvm' to override VirtualBox defaults
dev_server_config.vm.customize ["modifyvm", :id, "--memory", 512]
dev_server_config.vm.customize ["modifyvm", :id, "--name", "Dev-test"]
dev_server_config.vm.customize ["modifyvm", :id, "--usb", "off"]
dev_server_config.vm.provision :chef_client do |chef|
chef.environment = "dev"
chef.chef_server_url = "http://10.11.12.13:4000"
chef.validation_key_path = "~/.chef/mbrennan.pem"
chef.validation_client_name = "mbrennan"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment