Created
December 10, 2012 03:41
-
-
Save juanje/4248259 to your computer and use it in GitHub Desktop.
Example of config for bootstraping an Aentos project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
site :opscode | |
cookbook 'mongodb' | |
cookbook 'postgresql', '= 2.0.0' | |
cookbook 'apt' | |
cookbook 'sudo' | |
cookbook 'conf' | |
cookbook 'rvm', git: 'git://github.com/fnichol/chef-rvm.git', branch: "v0.9.0" | |
cookbook 'aentos-bootstrap', git: 'git://github.com/aentos/cookbook-aentos-bootstrap.git' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "http://rubygems.org" | |
gem 'berkshelf' | |
gem 'vagrant-bindfs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"run_list": [ | |
"recipe[apt]", | |
"recipe[aentos-bootstrap::test]" | |
], | |
"bootstrap": { | |
"postgresql_password": "newsupersecret" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'berkshelf/vagrant' | |
require 'json' | |
def local_cache(box_name) | |
cache_dir = File.join(File.expand_path(Vagrant::Environment::DEFAULT_HOME), | |
'cache', | |
'apt', | |
box_name) | |
partial_dir = File.join(cache_dir, 'partial') | |
FileUtils.mkdir_p(partial_dir) unless File.exists? partial_dir | |
cache_dir | |
end | |
Vagrant::Config.run do |config| | |
config.vm.box = "ubuntu-12.04-nfs-i386" | |
config.vm.box_url = "http://github.com/downloads/juanje/bento/ubuntu-12.04-nfs-i386.box" | |
cache_dir = local_cache(config.vm.box) | |
config.vm.share_folder "v-cache", "/var/cache/apt/archives/", cache_dir, :nfs => true | |
# Here we share the host's directory '../' as a directory '/vagrant-nfs' inside the VM | |
config.vm.share_folder "v-code", "/vagrant-nfs", "../", :nfs => true | |
# Now we mount with bindfs (inside the VM) '/vagrant-nfs' on '/mnt/code' | |
# This also will mount all the files and directories with the user 'vagrant' as owner | |
config.bindfs.bind_folder "/vagrant-nfs", "/mnt/code/", :create_as_user => true | |
# You need to fix a hostonly IP and this network seems to be safe | |
config.vm.network :hostonly, "33.33.33.10" | |
config.vm.provision :chef_solo do |chef| | |
# This isn't really necessary, but may help running Chef | |
chef.nfs = true | |
chef.run_list = [ | |
"recipe[aentos-bootstrap]" | |
] | |
chef.json = JSON.parse(IO.read('solo.json'),{symbolize_names: true}) if File.exists? 'solo.json' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment