Created
February 24, 2014 21:13
-
-
Save MattVonVielen/9197226 to your computer and use it in GitHub Desktop.
Self-taught Vagrant surgery using Redmine as the victim
This file contains hidden or 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 'apt' | |
cookbook 'mysql' |
This file contains hidden or 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
# Install the BrightBox Ruby 2.0 packages | |
package 'python-software-properties' | |
execute 'add-apt-repository ppa:brightbox/ruby-ng' | |
execute 'apt-get update' | |
package 'ruby2.0' | |
package 'ruby2.0-dev' | |
# Install build-dependencies for redmine's Gemfile | |
package 'libmysqlclient-dev' | |
package 'libmagickwand-dev' | |
package 'libsqlite3-dev' | |
# Install bundler and run bundle install | |
gem_package 'bundler' | |
execute 'bundle install --gemfile=/vagrant/Gemfile' |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.require_plugin "vagrant-berkshelf" | |
Vagrant.require_plugin "vagrant-omnibus" | |
Vagrant.require_plugin "vagrant-chef-apply" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "precise64" | |
#config.vm.box_url = "custom provisionerless box image" | |
config.berkshelf.enabled = true | |
config.omnibus.chef_version = :latest | |
config.vm.define :rails do |rails| | |
rails.vm.network :forwarded_port, guest: 3000, host: 3000 | |
rails.vm.network :private_network, ip: "192.168.50.2" | |
rails.vm.provision :chef_solo do |chef| | |
chef.add_recipe 'apt' | |
end | |
rails.vm.provision :chef_apply do |chef| | |
chef.path = 'redmine_recipe.rb' | |
end | |
end | |
config.vm.define :db do |db| | |
db.vm.network :private_network, ip: "192.168.50.4" | |
db.vm.provision :chef_solo do |chef| | |
chef.json = { | |
:mysql => { | |
:server_root_password => "vagrant", | |
:server_repl_password => "vagrant", | |
:server_debian_password => "vagrant" | |
} | |
} | |
chef.run_list = [ | |
"recipe[apt]", | |
"recipe[mysql::server]" | |
] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alright, calling it surgery is being pretty generous...