Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup automatic virtual server provisioning with vagrant and chef
* install and configure vagrant gem * install and configure librarian gem * add mongodb-debs cookbook * add rails-lastmile cookbook * update README
- Loading branch information
Showing
26 changed files
with
617 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ config/github.yml | |
config/twitter.yml | ||
.DS_Store | ||
public/assets | ||
cookbooks/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"active":{"default":"851c4939-651b-499c-b6d9-77d5cd98f848"}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env ruby | ||
#^syntax detection | ||
|
||
site 'http://community.opscode.com/api/v1' | ||
|
||
# cookbook 'chef-client' | ||
|
||
# cookbook 'apache2', '>= 1.0.0' | ||
|
||
# cookbook 'rvm', | ||
# :git => 'https://github.com/fnichol/chef-rvm' | ||
|
||
# cookbook 'postgresql', | ||
# :git => 'https://github.com/findsyou/cookbooks', | ||
# :ref => 'postgresql-improvements' | ||
|
||
cookbook 'ruby_build', | ||
:git => 'git://github.com/fnichol/chef-ruby_build.git', :ref => 'v0.6.0' | ||
cookbook 'rbenv', | ||
:git => 'https://github.com/fnichol/chef-rbenv', :ref => 'v0.6.4' | ||
cookbook 'apt', | ||
:git => 'https://github.com/fnichol/chef-apt' | ||
|
||
cookbook 'nginx' | ||
cookbook 'vim' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
SITE | ||
remote: http://community.opscode.com/api/v1 | ||
specs: | ||
bluepill (1.0.6) | ||
build-essential (1.1.0) | ||
nginx (0.101.6) | ||
bluepill (>= 0.0.0) | ||
build-essential (>= 0.0.0) | ||
ohai (~> 1.0.2) | ||
runit (>= 0.0.0) | ||
yum (>= 0.0.0) | ||
ohai (1.0.2) | ||
runit (0.15.0) | ||
vim (1.0.2) | ||
yum (0.6.2) | ||
|
||
GIT | ||
remote: git://github.com/fnichol/chef-ruby_build.git | ||
ref: v0.6.0 | ||
sha: f5eae16a199571d15f151f118338b3b11c42f694 | ||
specs: | ||
ruby_build (0.6.0) | ||
|
||
GIT | ||
remote: https://github.com/fnichol/chef-apt | ||
ref: master | ||
sha: cb998dfdeffbcbb6805527b046b411206d6c77d6 | ||
specs: | ||
apt (1.2.0) | ||
|
||
GIT | ||
remote: https://github.com/fnichol/chef-rbenv | ||
ref: v0.6.4 | ||
sha: 4e87a6d477cb6d675eed060e46910cb88d3f4448 | ||
specs: | ||
rbenv (0.6.4) | ||
|
||
DEPENDENCIES | ||
apt (>= 0) | ||
nginx (>= 0) | ||
rbenv (>= 0) | ||
ruby_build (>= 0) | ||
vim (>= 0) | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
Vagrant::Config.run do |config| | ||
# All Vagrant configuration is done here. The most common configuration | ||
# options are documented and commented below. For a complete reference, | ||
# please see the online documentation at vagrantup.com. | ||
|
||
# Every Vagrant virtual environment requires a box to build off of. | ||
config.vm.box = "lucid32" | ||
|
||
# The url from where the 'config.vm.box' box will be fetched if it | ||
# doesn't already exist on the user's system. | ||
config.vm.box_url = "http://files.vagrantup.com/lucid32.box" | ||
|
||
# Boot with a GUI so you can see the screen. (Default is headless) | ||
# config.vm.boot_mode = :gui | ||
|
||
# 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 :hostonly, "192.168.33.10" | ||
|
||
# Assign this VM to a bridged network, allowing you to connect directly to a | ||
# network using the host's network device. This makes the VM appear as another | ||
# physical device on your network. | ||
# config.vm.network :bridged | ||
|
||
# Forward a port from the guest to the host, which allows for outside | ||
# computers to access the VM, whereas host only networking does not. | ||
config.vm.forward_port 80, 8080 | ||
|
||
# Share an additional folder to the guest VM. The first argument is | ||
# an identifier, the second is the path on the guest to mount the | ||
# folder, and the third is the path on the host to the actual folder. | ||
# config.vm.share_folder "v-data", "/vagrant_data", "../data" | ||
|
||
# Enable provisioning with Puppet stand alone. Puppet manifests | ||
# are contained in a directory path relative to this Vagrantfile. | ||
# You will need to create the manifests directory and a manifest in | ||
# the file base.pp in the manifests_path directory. | ||
# | ||
# An example Puppet manifest to provision the message of the day: | ||
# | ||
# # group { "puppet": | ||
# # ensure => "present", | ||
# # } | ||
# # | ||
# # File { owner => 0, group => 0, mode => 0644 } | ||
# # | ||
# # file { '/etc/motd': | ||
# # content => "Welcome to your Vagrant-built virtual machine! | ||
# # Managed by Puppet.\n" | ||
# # } | ||
# | ||
# config.vm.provision :puppet do |puppet| | ||
# puppet.manifests_path = "manifests" | ||
# puppet.manifest_file = "base.pp" | ||
# end | ||
|
||
# Enable provisioning with chef solo, specifying a cookbooks path, roles | ||
# path, and data_bags path (all relative to this Vagrantfile), and adding | ||
# some recipes and/or roles. | ||
|
||
config.vm.provision :chef_solo do |chef| | ||
chef.cookbooks_path = ["cookbooks", "site-cookbooks"] | ||
|
||
chef.add_recipe "apt" | ||
chef.add_recipe "ruby_build" | ||
chef.add_recipe "rbenv::system" | ||
chef.add_recipe "rbenv::vagrant" | ||
chef.add_recipe "nginx" | ||
chef.add_recipe "mongodb-debs" | ||
chef.add_recipe "rails-lastmile" | ||
|
||
chef.json = { | ||
'rvm' => { | ||
'default_ruby' => 'ruby-1.9.2-p290', | ||
'gem_package' => { | ||
'rvm_string' => 'ruby-1.9.2-p290' | ||
} | ||
} | ||
} | ||
end | ||
|
||
# Enable provisioning with chef server, specifying the chef server URL, | ||
# and the path to the validation key (relative to this Vagrantfile). | ||
# | ||
# The Opscode Platform uses HTTPS. Substitute your organization for | ||
# ORGNAME in the URL and validation key. | ||
# | ||
# If you have your own Chef Server, use the appropriate URL, which may be | ||
# HTTP instead of HTTPS depending on your configuration. Also change the | ||
# validation key to validation.pem. | ||
# | ||
# config.vm.provision :chef_client do |chef| | ||
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME" | ||
# chef.validation_key_path = "ORGNAME-validator.pem" | ||
# end | ||
# | ||
# If you're using the Opscode platform, your validator client is | ||
# ORGNAME-validator, replacing ORGNAME with your organization name. | ||
# | ||
# IF you have your own Chef Server, the default validation client name is | ||
# chef-validator, unless you changed the configuration. | ||
# | ||
# chef.validation_client_name = "ORGNAME-validator" | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
= DESCRIPTION: | ||
|
||
Installs mongodb from debian pacakges based on the instructions from | ||
http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages | ||
|
||
= REQUIREMENTS: | ||
|
||
== Platform: | ||
|
||
Tested on Ubuntu 10.04, Debian Lenny. | ||
|
||
= USAGE: | ||
|
||
Include the mongodb-debs recipe to install mongodb on your system: | ||
|
||
include_recipe "mongodb-debs" | ||
|
||
= LICENSE and AUTHOR: | ||
|
||
Author:: Marius Ducea (marius@promethost.com) | ||
|
||
Copyright:: 2010, Promet Solutions | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
maintainer "Promet Solutions" | ||
maintainer_email "marius@promethost.com" | ||
license "Apache 2.0" | ||
description "Installs MongoDB" | ||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc')) | ||
version "0.2.0" | ||
|
||
%w{ ubuntu debian }.each do |os| | ||
supports os | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# | ||
# Author:: Marius Ducea (marius@promethost.com) | ||
# Cookbook Name:: mongodb | ||
# Recipe:: default | ||
# | ||
# Copyright 2010, Promet Solutions | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
include_recipe "mongodb-debs::repo" | ||
|
||
package "mongodb-10gen" | ||
|
||
service "mongodb" do | ||
action [ :enable, :start ] | ||
end | ||
|
||
template "/etc/mongodb.conf" do | ||
source "mongodb.conf.erb" | ||
owner "root" | ||
group "root" | ||
mode 0644 | ||
notifies :restart, resources(:service => "mongodb") | ||
end |
Oops, something went wrong.