Skip to content

Commit

Permalink
new build with rvm supporting ruby 1.8.7 and 1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
seamusabshere committed Oct 1, 2010
1 parent 581dd86 commit 13c1442
Show file tree
Hide file tree
Showing 11 changed files with 360 additions and 218 deletions.
6 changes: 4 additions & 2 deletions Vagrantfile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ Vagrant::Config.run do |config|
config.vm.customize do |vm| config.vm.customize do |vm|
vm.memory_size = 512 vm.memory_size = 512
end end
config.chef.json[:network] = (ENV['NETWORK'] != 'false') config.chef.json[:hagar_net] = ENV['NET']
config.chef.json[:hagar_apps] = Dir[File.join(hagar_root, 'apps_enabled', '*')].map { |name| File.basename(name) } config.chef.json[:hagar_apps] = Dir[File.join(hagar_root, 'apps_enabled', '*')].map { |name| File.basename(name) }
config.chef.json[:hagar_gems] = Dir[File.join(hagar_root, 'gems_enabled', '*')].map { |name| File.basename(name) } config.chef.json[:hagar_gems] = Dir[File.join(hagar_root, 'gems_enabled', '*')].map { |name| File.basename(name) }
config.chef.json[:recipes] = ['vagrant_main'] # config.chef.json[:recipes] = ['vagrant_main']
config.vm.provisioner = :chef_solo config.vm.provisioner = :chef_solo
config.chef.cookbooks_path = "vagrant/chef-repo/cookbooks" config.chef.cookbooks_path = "vagrant/chef-repo/cookbooks"
config.chef.run_list.clear
config.chef.add_recipe "vagrant_main"
config.vm.forward_port "ssh", 22, 2222 config.vm.forward_port "ssh", 22, 2222
config.vm.forward_port "web", 80, 4567 config.vm.forward_port "web", 80, 4567
config.vm.forward_port "web2", 8080, 5678 config.vm.forward_port "web2", 8080, 5678
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,11 @@
# Generated by Chef for <%= node[:fqdn] %>. # Generated by Chef for <%= node[:fqdn] %>.
# Local modifications will be overwritten. # Local modifications will be overwritten.


# sabshere 9/28/10
# Set the server root password. This should be preseeded by the package installation.
UPDATE mysql.user SET password = PASSWORD('password');
FLUSH PRIVILEGES;

<% case node[:platform] -%> <% case node[:platform] -%>
<% when "debian","ubuntu" -%> <% when "debian","ubuntu" -%>
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '<%= node[:mysql][:server_debian_password] %>' WITH GRANT OPTION; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '<%= node[:mysql][:server_debian_password] %>' WITH GRANT OPTION;
Expand All @@ -9,4 +14,5 @@ GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, F
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%' identified by '<%= node[:mysql][:server_repl_password] %>'; GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%' identified by '<%= node[:mysql][:server_repl_password] %>';


# Set the server root password. This should be preseeded by the package installation. # Set the server root password. This should be preseeded by the package installation.
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('<%= node[:mysql][:server_root_password] %>'); # sabshere 9/28/10 DISABLED ... look up
# SET PASSWORD FOR 'root'@'localhost' = PASSWORD('<%= node[:mysql][:server_root_password] %>');
48 changes: 47 additions & 1 deletion vagrant/chef-repo/cookbooks/tomcat6/attributes/default.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,7 +42,53 @@


set_unless[:tomcat6][:version] = "6.0.18" set_unless[:tomcat6][:version] = "6.0.18"
set_unless[:tomcat6][:with_native] = false set_unless[:tomcat6][:with_native] = false
set_unless[:tomcat6][:with_snmp] = !languages[:java][:runtime][:name].match(/^OpenJDK/) # sabshere 9/28/10
# vagrant@vagrantup:~$ cd /tmp/vagrant-chef && sudo -E chef-solo -c solo.rb -j dna.json
# [Tue, 28 Sep 2010 09:11:33 -0700] INFO: Setting the run_list to [] from JSON
# [Tue, 28 Sep 2010 09:11:33 -0700] INFO: Starting Chef Run (Version 0.9.8)
# [Tue, 28 Sep 2010 09:11:37 -0700] WARN: Missing gem 'mysql'
# [Tue, 28 Sep 2010 09:11:37 -0700] WARN: Missing gem 'right_aws'
# [Tue, 28 Sep 2010 09:11:37 -0700] ERROR: Running exception handlers
# [Tue, 28 Sep 2010 09:11:37 -0700] ERROR: Exception handlers complete
# [Tue, 28 Sep 2010 09:11:37 -0700] ERROR: Re-raising exception: NoMethodError - undefined method `[]' for nil:NilClass
# /tmp/vagrant-chef/cookbooks-0/tomcat6/attributes/default.rb:45:in `from_file'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/node.rb:531:in `load_attributes'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/node.rb:529:in `each'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/node.rb:529:in `load_attributes'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/node.rb:528:in `each'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/node.rb:528:in `load_attributes'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/run_context.rb:74:in `load'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/run_context.rb:55:in `initialize'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:84:in `new'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:84:in `run'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:191:in `run_application'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in `loop'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in `run_application'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:in `run'
# /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25
# /usr/bin/chef-solo:19:in `load'
# /usr/bin/chef-solo:19
# /tmp/vagrant-chef/cookbooks-0/tomcat6/attributes/default.rb:45:in `from_file': undefined method `[]' for nil:NilClass (NoMethodError)
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/node.rb:531:in `load_attributes'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/node.rb:529:in `each'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/node.rb:529:in `load_attributes'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/node.rb:528:in `each'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/node.rb:528:in `load_attributes'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/run_context.rb:74:in `load'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/run_context.rb:55:in `initialize'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:84:in `new'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:84:in `run'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:191:in `run_application'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in `loop'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/solo.rb:181:in `run_application'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:in `run'
# from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-solo:25
# from /usr/bin/chef-solo:19:in `load'
# from /usr/bin/chef-solo:19
begin
set_unless[:tomcat6][:with_snmp] = !languages[:java][:runtime][:name].match(/^OpenJDK/)
rescue NoMethodError
end
set_unless[:tomcat6][:java_home] = "/usr/lib/jvm/java" set_unless[:tomcat6][:java_home] = "/usr/lib/jvm/java"
# snmp_opts fail with OpenJDK - results in silent exit(1) from the jre # snmp_opts fail with OpenJDK - results in silent exit(1) from the jre
if tomcat6[:with_snmp] if tomcat6[:with_snmp]
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,6 @@
set[:mysql][:sabshere_override_password] = 'password'
set[:mysql][:server_root_password] = 'password' set[:mysql][:server_root_password] = 'password'
set[:mysql][:server_debian_password] = 'password' set[:mysql][:server_debian_password] = 'password'
set[:mysql][:bind_address] = '0.0.0.0' set[:mysql][:bind_address] = '0.0.0.0'
set[:apache][:user] = 'vagrant' set[:apache][:user] = 'vagrant'
set[:passenger_enterprise][:version] = "2.2.11" # set[:passenger_enterprise][:version] = "2.2.11"
set[:passenger][:version] = "2.2.11" # set[:passenger][:version] = "2.2.11"
30 changes: 30 additions & 0 deletions vagrant/chef-repo/cookbooks/vagrant_main/files/default/gem.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/ruby1.8
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

# sabshere 9/30/10 to break myself of the habit
if ENV['SUDO_COMMAND'] =~ /^\/usr\/bin\/gem/
raise '[hagar1] If you want to sudo gem, first sudo su'
end

require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'

required_version = Gem::Requirement.new ">= 1.8.6"

unless required_version.satisfied_by? Gem.ruby_version then
abort "Expected Ruby Version #{required_version}, is #{Gem.ruby_version}"
end

args = ARGV.clone

begin
Gem::GemRunner.new.run args
rescue Gem::SystemExitException => e
exit e.exit_code
end

49 changes: 0 additions & 49 deletions vagrant/chef-repo/cookbooks/vagrant_main/files/default/rep.rb

This file was deleted.

Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env ruby
puts "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
Loading

0 comments on commit 13c1442

Please sign in to comment.