Skip to content

Instantly share code, notes, and snippets.

@mattyod
Last active August 29, 2015 13:57
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 mattyod/9683290 to your computer and use it in GitHub Desktop.
Save mattyod/9683290 to your computer and use it in GitHub Desktop.
Vagrant.configure("2") do |config|
#provider blocks
config.vm.provider :virtualbox do |config, override|
override.vm.box = "opscode-ubuntu-12.04"
override.vm.box_url = "https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box"
config.vm.network :private_network, ip: "192.168.56.11"
config.customize ["modifyvm", :id, "--memory", 1024]
end
config.vm.provider "aws" do |aws, override|
override.vm.box = "dummy"
override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
aws.access_key_id = ENV['AWS_ACCESS_KEY']
aws.secret_access_key = ENV['AWS_SECRET_KEY']
aws.keypair_name = ""
aws.ami = "ami-66ef0111"
aws.region = "eu-west-1"
aws.security_groups = [ "NIAccess" ]
aws.tags = {
"Name" => "",
"ServiceName" => "",
"ServiceOwner" => "",
"CostCentre" => ""
}
override.ssh.username = "ubuntu"
override.ssh.private_key_path = ""
end
#configure chef installation and cookbooks
config.berkshelf.enabled = true
config.omnibus.chef_version = :latest
#configure chef solo
config.vm.provision :chef_solo do |chef|
chef.log_level = :info
chef.json = {
:java => {
"jdk_version" => "7",
"install_flavor" => 'oracle',
:oracle => {
"accept_oracle_download_terms" => true
}
},
"elasticsearch" => {
"cluster" => { "name" => "elasticsearch_test" }
},
"nodejs" => { "version" => "0.10.26" }
}
chef.run_list = [
"recipe[java]",
"recipe[elasticsearch]",
"recipe[nodejs]"
]
end
config.vm.synced_folder ".", "/vagrant"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment