# -*- mode: ruby -*-
# vi: set ft=ruby :
# We'll mount the Chef::Config[:file_cache_path] so it persists between
# Vagrant VMs
host_cache_path = File.expand_path("../.cache", __FILE__)
guest_cache_path = "/tmp/vagrant-cache"
# ensure the cache path exists
FileUtils.mkdir(host_cache_path) unless File.exist?(host_cache_path)
Vagrant.configure("2") do |config|
config.vm.hostname = "gc-sentinel-berkshelf"
config.vm.box = "ubuntu-12.04"
# this requires vagrant-omnibus plugin to be installed
config.omnibus.chef_version = "10.24.4"
# 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 :private_network, ip: "33.33.33.10"
config.ssh.max_tries = 40
config.ssh.timeout = 120
# Enabling the Berkshelf plugin. To enable this globally, add this configuration
# option to your ~/.vagrant.d/Vagrantfile file
config.berkshelf.enabled = true
# requires vagrant-hostmanager plugin to be intalled
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
# run hostmaster before chef_solo provisioning
config.vm.provision :hostmanager
config.vm.provision :chef_solo do |chef|
chef.log_level = "debug"
chef.provisioning_path = guest_cache_path
chef.data_bags_path = "../data_bags"
chef.run_list = [
"recipe[apt]",
"recipe[gc_sentinel::default]"
]
end
config.vm.synced_folder host_cache_path, guest_cache_path
end