Permalink
Browse files

new build with rvm supporting ruby 1.8.7 and 1.9.2

  • Loading branch information...
1 parent 581dd86 commit 13c1442fb53c148b1600891e86dcc7f891218460 @seamusabshere seamusabshere committed Oct 1, 2010
View
@@ -5,12 +5,14 @@ Vagrant::Config.run do |config|
config.vm.customize do |vm|
vm.memory_size = 512
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_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.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 "web", 80, 4567
config.vm.forward_port "web2", 8080, 5678
@@ -1,6 +1,11 @@
# Generated by Chef for <%= node[:fqdn] %>.
# 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] -%>
<% 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;
@@ -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] %>';
# 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] %>');
@@ -42,7 +42,53 @@
set_unless[:tomcat6][:version] = "6.0.18"
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"
# snmp_opts fail with OpenJDK - results in silent exit(1) from the jre
if tomcat6[:with_snmp]
@@ -1,7 +1,6 @@
-set[:mysql][:sabshere_override_password] = 'password'
set[:mysql][:server_root_password] = 'password'
set[:mysql][:server_debian_password] = 'password'
set[:mysql][:bind_address] = '0.0.0.0'
set[:apache][:user] = 'vagrant'
-set[:passenger_enterprise][:version] = "2.2.11"
-set[:passenger][:version] = "2.2.11"
+# set[:passenger_enterprise][:version] = "2.2.11"
+# set[:passenger][:version] = "2.2.11"
@@ -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
+
@@ -1,49 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'fileutils'
-require 'rubygems'
-require 'active_support'
-require 'active_support/version'
-%w{
- active_support/core_ext/object/blank
-}.each do |active_support_3_requirement|
- require active_support_3_requirement
-end if ActiveSupport::VERSION::MAJOR == 3
-
-class StringReplacer
- NEWLINE = "AijQA6tD1wkWqgvLzXD"
- START_MARKER = '# START StringReplacer %s -- DO NOT MODIFY'
- END_MARKER = "# END StringReplacer %s -- DO NOT MODIFY#{NEWLINE}"
-
- attr_accessor :path
- def initialize(path)
- @path = path
- end
-
- def replace!(replacement, id, after_line)
- id = 1 unless id.present?
- after_line = nil unless after_line.present?
- new_path = "#{path}.new"
- backup_path = "#{path}.bak"
- current_start_marker = START_MARKER % id.to_s
- current_end_marker = END_MARKER % id.to_s
- replacement_with_markers = current_start_marker + NEWLINE + replacement + NEWLINE + current_end_marker
- text = IO.read(path).gsub("\n", NEWLINE)
- if text.include? current_start_marker
- text.sub! /#{Regexp.escape current_start_marker}.*#{Regexp.escape current_end_marker}/, replacement_with_markers
- elsif after_line
- text.sub! /(#{Regexp.escape after_line}#{Regexp.escape NEWLINE})/, '\1' + replacement_with_markers
- else
- text << NEWLINE << replacement_with_markers
- end
- text.gsub! NEWLINE, "\n"
- File.open(new_path, 'w') { |f| f.write text }
- FileUtils.mv path, backup_path
- FileUtils.mv new_path, path
- end
-end
-
-target, replacement, id, after_line = ARGV
-
-s = StringReplacer.new(target)
-s.replace! replacement, id, after_line
@@ -0,0 +1,2 @@
+#!/usr/bin/env ruby
+puts "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
Oops, something went wrong.

0 comments on commit 13c1442

Please sign in to comment.