|
# -*- mode: ruby -*- |
|
# vi: set ft=ruby : |
|
|
|
Vagrant.configure("2") do |config| |
|
# These two for Virtual Box |
|
#config.vm.box = "vagrant-graphite" |
|
#config.vm.box_url = "http://files.vagrantup.com/precise64.box" |
|
config.vm.box = "ubuntu/trusty64" |
|
config.vm.box_url = "https://vagrantcloud.com/ubuntu/boxes/trusty64" |
|
# This one for AWS |
|
#config.vm.box= "dummy" |
|
|
|
config.vm.network :forwarded_port, guest: 80, host: 2280 |
|
config.vm.network :forwarded_port, guest: 8080, host: 2880 |
|
config.vm.network :forwarded_port, guest: 2003, host: 2003 |
|
config.vm.network :forwarded_port, guest: 8125, host: 8125, :protocol => 'udp' |
|
config.vm.network :forwarded_port, guest: 8126, host: 8126, :protocol => 'tcp' |
|
|
|
# config.vm.network :private_network, ip: "192.168.33.10" |
|
config.vm.network :public_network |
|
|
|
config.vm.provider :virtualbox do |vb| |
|
# Don't boot with headless mode |
|
# vb.gui = true |
|
|
|
# Use VBoxManage to customize the VM. For example to change memory: |
|
vb.customize ["modifyvm", :id, "--memory", "1024"] |
|
end |
|
|
|
config.vm.provider :aws do |aws, override| |
|
aws.access_key_id = "xxx" |
|
aws.secret_access_key = "xxx" |
|
aws.keypair_name = "MyKeyPair" |
|
|
|
aws.ami = "ami-3d50120d" |
|
#aws.ami = "ami-99bef1a9" |
|
aws.instance_type = "t2.small" |
|
aws.associate_public_ip = "true" |
|
aws.region = "us-west-2" |
|
aws.subnet_id = "subnet-0a46ab7d" |
|
|
|
override.ssh.username = "ubuntu" |
|
override.ssh.private_key_path = "~/.ssh/MyKeyPair.pem" |
|
end |
|
|
|
|
|
# You need to ensure you have the right version of Chef installed on the box |
|
# vagrant plugin install vagrant-omnibus |
|
config.omnibus.chef_version = "11.6.0" |
|
|
|
# in addition to the very basics, we also have vbguest installed |
|
# vagrant plugin install vagrant-vbguest |
|
config.vbguest.auto_update = true |
|
|
|
# Chef Solo |
|
config.vm.provision :chef_solo do |chef| |
|
chef.cookbooks_path = "cookbooks" |
|
chef.add_recipe "apt" |
|
chef.add_recipe "apache2" |
|
chef.add_recipe "apache2::mod_wsgi" |
|
chef.add_recipe "python" |
|
chef.add_recipe "oc-graphite::graphite_carbon" |
|
chef.add_recipe "oc-graphite::graphite_web" |
|
chef.add_recipe "statsd" |
|
chef.add_recipe "vim" |
|
|
|
chef.json = { |
|
:graphite => { |
|
:version => '0.9.9', |
|
:python_version => '2.7', |
|
:twisted_version => '13.1.0', |
|
:password => 'admin', |
|
:carbon => { |
|
:line_receiver_interface => '0.0.0.0' |
|
}, |
|
:whisper => { |
|
}, |
|
:graphite_web => { |
|
} |
|
}, |
|
:statsd => { |
|
:graphite => { |
|
:global_prefix => 'statsd' |
|
}, |
|
:nodejs_bin => '/usr/bin/node' |
|
}, |
|
'oc-graphite' => { |
|
:web => { |
|
:secret_key => 'IHateGraphite' |
|
} |
|
} |
|
} |
|
end |
|
end |