Permalink
Browse files

Merged

  • Loading branch information...
2 parents d269a70 + e189e3c commit 516b559f4ba9459e6f729f89dc94fb80d5b2ada9 @auser auser committed Apr 6, 2009
View
@@ -4,7 +4,6 @@
pkg/*.tgz
pkg/poolparty*/*
.git/
-.gitignore
log/
log/*
test_manifest.pp
@@ -2,6 +2,7 @@ module PoolParty
class Base
plugin :poolparty_base_packages do
+ has_package "erlang"
# def enable
# # Build hostsfile
#
@@ -48,6 +48,7 @@ def self.launch_new_instance!(o = options)
:availability_zone => o[:availabilty_zone],
:instance_type => o[:size],
:group_id => o[:security_group])
+
begin
h = EC2ResponseObject.get_hash_from_response(instance.instancesSet.item.first)
#h = instance.instancesSet.item.first
@@ -1,3 +1,5 @@
+# Convenience class to convert standard amazon-ec2 responses from their camel cased style to a hash using underscore style.
+# For example: instanceId to instance_id
class EC2ResponseObject
def self.get_descriptions(resp)
rs = get_instance_from_response(resp)
@@ -62,6 +64,6 @@ def self.get_hash_from_response(resp, group = 'default')
rescue Exception => e
puts "E: #{e}"
nil
- end
+ end
end
end
@@ -48,7 +48,6 @@ def method_missing(sym, *args, &block)
# else
# super
# end
-
if parent.respond_to?(sym)
parent.send(sym, *args, &block)
elsif provisioner.respond_to?(sym)
@@ -46,7 +46,7 @@ def install_provisioner
desc "Create poolparty commands"
def create_poolparty_commands
end
-
+
desc "Fix rubygems"
def fix_rubygems
# echo '#{open(::File.join(template_directory, "gem")).read}' > /usr/bin/gem &&
@@ -153,5 +153,12 @@ def copy_gem_bins_to_usr_bin
end
+ desc "ensure gem binaries are copied to /usr/bin/"
+ def copy_gem_bins_to_usr_bin
+ run 'GEMPATH=`gem env gempath` && cp $GEMPATH/bin/* /usr/bin/'
+ run 'ls /usr/bin/|grep server'
+ run 'echo --------- binaries copied ---------\n\n'
+ end
+
# end
end
@@ -26,7 +26,7 @@ def initialize(instance=nil, cld=nil, os=:ubuntu, &block)
options(cloud.options) if cloud && cloud.respond_to?(:options)
dputs "Using key at: #{cld.keypair}"
-
+
@os = os.to_s.downcase.to_sym
self.instance_eval &block if block
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+. /etc/profile
+echo 'checking if puppet is running'
+PUPRUN=`ps aux | grep \/usr\/bin\/puppet\/ | grep -v grep | wc -c`
+echo "$PUPRUN"
+if [ $PUPRUN -eq 0 ]; then
+ # /usr/bin/puppet -d --logdest syslog /etc/puppet/manifests/site.pp
+ /usr/bin/puppet -d /etc/puppet/manifests/site.pp
+ echo "puppet was run"
+ echo "puppet was run `date`">>/root/log/pool.log
+else
+ echo "puppet was not run. It may already be running."
+ echo "puppet was not run. It may already be running.">>/root/log/pool.log
+fi

0 comments on commit 516b559

Please sign in to comment.