auser-poolparty 0.2.9 → 0.2.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/Manifest.txt +33 -4
  2. data/PostInstall.txt +3 -1
  3. data/bin/cloud-provision +8 -4
  4. data/bin/cloud-start +2 -0
  5. data/bin/server-get-load +29 -0
  6. data/bin/server-list-active +1 -1
  7. data/bin/server-rerun +24 -0
  8. data/config/requirements.rb +1 -1
  9. data/lib/erlang/messenger/Makefile +15 -0
  10. data/lib/erlang/messenger/README +5 -0
  11. data/lib/erlang/messenger/Rakefile +39 -0
  12. data/lib/erlang/messenger/control +11 -0
  13. data/lib/erlang/messenger/ebin/erl_crash.dump +12138 -0
  14. data/lib/erlang/messenger/ebin/load_app.beam +0 -0
  15. data/lib/erlang/messenger/ebin/pm_master.beam +0 -0
  16. data/lib/erlang/messenger/ebin/pm_master_supervisor.beam +0 -0
  17. data/lib/erlang/messenger/ebin/pm_node.beam +0 -0
  18. data/lib/erlang/messenger/ebin/pm_node_supervisor.beam +0 -0
  19. data/lib/erlang/messenger/lib/load_app.app +18 -0
  20. data/lib/erlang/messenger/src/load_app.erl +26 -0
  21. data/lib/erlang/messenger/src/pm_cluster.erl +31 -0
  22. data/lib/erlang/messenger/src/pm_master.erl +27 -0
  23. data/lib/erlang/messenger/src/pm_master_supervisor.erl +8 -0
  24. data/lib/erlang/messenger/src/pm_node.erl +79 -0
  25. data/lib/erlang/messenger/src/pm_node_supervisor.erl +33 -0
  26. data/lib/poolparty.rb +9 -6
  27. data/lib/poolparty/base_packages/haproxy.rb +9 -2
  28. data/lib/poolparty/base_packages/heartbeat.rb +31 -30
  29. data/lib/poolparty/base_packages/poolparty.rb +30 -17
  30. data/lib/poolparty/base_packages/ruby.rb +1 -2
  31. data/lib/poolparty/core/array.rb +2 -2
  32. data/lib/poolparty/core/hash.rb +16 -2
  33. data/lib/poolparty/core/string.rb +1 -1
  34. data/lib/poolparty/core/symbol.rb +2 -2
  35. data/lib/poolparty/dependency_resolutions/base.rb +12 -0
  36. data/lib/poolparty/dependency_resolutions/puppet.rb +49 -0
  37. data/lib/poolparty/helpers/display.rb +3 -3
  38. data/lib/poolparty/helpers/provisioner_base.rb +6 -6
  39. data/lib/poolparty/helpers/provisioners/master.rb +21 -21
  40. data/lib/poolparty/helpers/provisioners/slave.rb +4 -3
  41. data/lib/poolparty/modules/definable_resource.rb +1 -0
  42. data/lib/poolparty/modules/file_writer.rb +11 -18
  43. data/lib/poolparty/modules/method_missing_sugar.rb +1 -1
  44. data/lib/poolparty/modules/pretty_printer.rb +11 -11
  45. data/lib/poolparty/modules/resourcing_dsl.rb +57 -0
  46. data/lib/poolparty/monitors/base_monitor.rb +17 -3
  47. data/lib/poolparty/monitors/monitors/cpu_monitor.rb +15 -0
  48. data/lib/poolparty/monitors/monitors/memory_monitor.rb +23 -0
  49. data/lib/poolparty/net/remote_instance.rb +5 -0
  50. data/lib/poolparty/net/remoter.rb +12 -2
  51. data/lib/poolparty/net/remoter_base.rb +5 -1
  52. data/lib/poolparty/plugins/git.rb +24 -15
  53. data/lib/poolparty/pool/base.rb +1 -2
  54. data/lib/poolparty/pool/cloud.rb +14 -9
  55. data/lib/poolparty/pool/custom_resource.rb +6 -6
  56. data/lib/poolparty/pool/resource.rb +53 -104
  57. data/lib/poolparty/pool/resources/class_package.rb +4 -4
  58. data/lib/poolparty/pool/resources/conditional.rb +5 -1
  59. data/lib/poolparty/pool/resources/gem.rb +22 -8
  60. data/lib/poolparty/pool/resources/symlink.rb +10 -6
  61. data/lib/poolparty/pool/resources/variable.rb +1 -1
  62. data/lib/poolparty/templates/ha.cf +3 -3
  63. data/lib/poolparty/templates/haproxy.conf +3 -3
  64. data/lib/poolparty/templates/puppet.conf +1 -1
  65. data/lib/poolparty/version.rb +1 -1
  66. data/poolparty.gemspec +7 -5
  67. data/setup.rb +3 -3
  68. data/spec/poolparty/core/hash_spec.rb +19 -1
  69. data/spec/poolparty/dependency_resolutions/base_spec.rb +11 -0
  70. data/spec/poolparty/modules/file_writer_spec.rb +9 -0
  71. data/spec/poolparty/monitors/base_monitor_spec.rb +19 -0
  72. data/spec/poolparty/monitors/monitors/cpu_monitor_spec.rb +17 -0
  73. data/spec/poolparty/net/remote_instance_spec.rb +6 -1
  74. data/spec/poolparty/net/remoter_spec.rb +2 -1
  75. data/spec/poolparty/pool/cloud_spec.rb +15 -1
  76. data/spec/poolparty/pool/custom_resource_spec.rb +2 -2
  77. data/spec/poolparty/pool/plugin_spec.rb +4 -4
  78. data/spec/poolparty/pool/resource_spec.rb +39 -1
  79. data/spec/poolparty/pool/resources/gem_spec.rb +30 -3
  80. data/spec/poolparty/pool/resources/symlink_spec.rb +4 -1
  81. data/spec/poolparty/spec_helper.rb +1 -0
  82. data/website/index.html +1 -1
  83. metadata +40 -7
  84. data/lib/erlang/eb_server.erl +0 -27
  85. data/lib/poolparty/plugins/gem_package.rb +0 -30
  86. data/lib/poolparty/puppet_plugins/poolparty/plugins/puppet/parser/functions/activenodeips.rb +0 -11
  87. data/lib/poolparty/puppet_plugins/poolparty/plugins/puppet/parser/functions/activenodenames.rb +0 -11
@@ -43,19 +43,19 @@ module PoolParty
43
43
 
44
44
  end
45
45
 
46
- def resources_string_from_resources(resources, prev="\t")
46
+ def resources_string_from_resources(resources, pre="\t")
47
47
  @variables = resources.extract! {|name,resource| name == :variable}
48
48
  returning Array.new do |str|
49
49
  unless @variables.empty?
50
50
  str << "\n# Variables \n"
51
51
  @variables.each do |name, variable|
52
- str << variable.to_string("#{prev}")
52
+ str << variable.to_string("#{pre}")
53
53
  end
54
54
  end
55
55
 
56
56
  resources.each do |type, resource|
57
- str << "\n#{prev*2}# #{type}\n"
58
- str << resource.to_string("#{prev*2}")
57
+ str << "\n#{pre*2}# #{type}\n"
58
+ str << resource.to_string("#{pre*2}")
59
59
  end
60
60
  end.join("\n")
61
61
  end
@@ -25,7 +25,11 @@ module PoolParty
25
25
  true
26
26
  end
27
27
 
28
- def to_string(prev="")
28
+ def printable?
29
+ false
30
+ end
31
+
32
+ def to_string(pre="")
29
33
  returning Array.new do |output|
30
34
  output << "# #{name.sanitize}"
31
35
  output << "case #{attribute} {"
@@ -1,14 +1,28 @@
1
1
  module PoolParty
2
2
  module Resources
3
-
4
- def gem(opts={}, parent=self, &block)
5
- add_resource(:package, opts.merge({
6
- :provider => "gem",
7
- :requires => "Package[rubygems]"
8
- }), parent, &block)
3
+
4
+ class Gempackage < Resource
5
+
6
+ # When we call gempackage, we want the exec to run on the directory we suggest
7
+ # we also only want it to run if there is NOT a local gem already installed with
8
+ # the package details (version and name)
9
+ def loaded(opts={}, parent=self)
10
+ has_exec(opts.merge({:name => name, :cwd => "/tmp", :path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/var/lib/gems/1.8/bin"}), parent) do
11
+ command "gem install -y --no-ri --no-rdoc #{"--version #{version}" if version} #{"--source #{source}" if source} #{name}"
12
+ ifnot "gem list --local #{name} | grep #{name} #{"| grep #{version}" if version}"
13
+ end
14
+ end
15
+ def virtual_resource?
16
+ true
17
+ end
18
+ def printable?
19
+ true
20
+ end
21
+ def class_type_name
22
+ "Exec"
23
+ end
24
+
9
25
  end
10
26
 
11
- add_has_and_does_not_have_methods_for(:gem)
12
-
13
27
  end
14
28
  end
@@ -2,17 +2,21 @@ module PoolParty
2
2
  module Resources
3
3
 
4
4
  class Symlink < Resource
5
-
6
- def from(*args)
7
- options.merge!(:ensure => args[0])
8
- end
9
-
5
+
10
6
  def class_type_name
11
7
  "file"
12
8
  end
13
9
 
14
10
  def disallowed_options
15
- [:name]
11
+ [:name, :source]
12
+ end
13
+
14
+ def present
15
+ source
16
+ end
17
+
18
+ def printable?
19
+ true
16
20
  end
17
21
 
18
22
  end
@@ -8,7 +8,7 @@ module PoolParty
8
8
  :value => ""
9
9
  })
10
10
 
11
- def to_string(prev="\t")
11
+ def to_string(pre="\t")
12
12
  "$#{name} = #{value_string}"
13
13
  end
14
14
 
@@ -10,10 +10,10 @@ bcast eth0
10
10
  crm on
11
11
  logfile /var/log/ha.log
12
12
 
13
- <% ha_node_ips.each_with_index do |ip,index| -%>
14
- <% if $hostname != ha_nodenames[index] -%>
13
+ <% ha_node_ips.chomp.split(/\t/).each_with_index do |ip,index| -%>
14
+ <% if $hostname != ha_nodenames.chomp.split(/\t/)[index] -%>
15
15
  ucast eth0 <%= ip %>
16
16
  <% end %>
17
17
  <% end %>
18
18
 
19
- node <%= ha_nodenames.join(" ") %>
19
+ node <%= ha_nodenames %>
@@ -30,7 +30,7 @@ defaults
30
30
 
31
31
  listen <%= name_haproxy %>
32
32
  bind 0.0.0.0:<%= ports_haproxy.join(",0.0.0.0:") %>
33
- <% node_ips_haproxy.each_with_index do |ip, index| -%>
34
33
  cookie POOLPARTYPARTY
35
- server node<%= index %> <%= ip %>:<%= forwarding_port %> weight 1 check cookie
36
- <% end -%>
34
+ <%- node_ips_haproxy.chomp.split(/\t/).each_with_index do |ip, index| -%>
35
+ server <%= index == 0 ? "master" : "node#{index}" %> <%= ip %>:<%= forwarding_port %> weight 1 check cookie
36
+ <%- end -%>
@@ -1,7 +1,7 @@
1
1
  [main]
2
2
  vardir = /var/lib/puppet
3
3
  logdir = /var/log/puppet
4
- pluginsync=true
4
+ pluginsync=false
5
5
  factsync=false
6
6
 
7
7
  [puppetd]
@@ -2,7 +2,7 @@ module PoolParty
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 9
5
+ TINY = 15
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -1,15 +1,15 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{poolparty}
3
- s.version = "0.2.9"
3
+ s.version = "0.2.15"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Ari Lerner"]
7
- s.date = %q{2008-10-16}
7
+ s.date = %q{2008-10-20}
8
8
  s.description = %q{Self-healing, auto-scaling cloud computing tool}
9
9
  s.email = ["ari.lerner@citrusbyte.com"]
10
- s.executables = ["cloud", "cloud-add-keypair", "cloud-configure", "cloud-contract", "cloud-expand", "cloud-list", "cloud-maintain", "cloud-osxcopy", "cloud-provision", "cloud-refresh", "cloud-ssh", "cloud-start", "cloud-terminate", "pool", "pool-console", "pool-describe", "pool-list", "pool-provision", "pool-spec", "pool-start", "pool-start-monitor", "server-list-active"]
10
+ s.executables = ["cloud", "cloud-add-keypair", "cloud-configure", "cloud-contract", "cloud-expand", "cloud-list", "cloud-maintain", "cloud-osxcopy", "cloud-provision", "cloud-refresh", "cloud-ssh", "cloud-start", "cloud-terminate", "pool", "pool-console", "pool-describe", "pool-list", "pool-provision", "pool-spec", "pool-start", "pool-start-monitor", "server-get-load", "server-list-active", "server-rerun"]
11
11
  s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "website/index.txt"]
12
- s.files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "bin/cloud", "bin/cloud-add-keypair", "bin/cloud-configure", "bin/cloud-contract", "bin/cloud-expand", "bin/cloud-list", "bin/cloud-maintain", "bin/cloud-osxcopy", "bin/cloud-provision", "bin/cloud-refresh", "bin/cloud-ssh", "bin/cloud-start", "bin/cloud-terminate", "bin/pool", "bin/pool-console", "bin/pool-describe", "bin/pool-list", "bin/pool-provision", "bin/pool-spec", "bin/pool-start", "bin/pool-start-monitor", "bin/server-list-active", "config/hoe.rb", "config/requirements.rb", "examples/basic.rb", "examples/plugin_without_plugin_directory.rb", "examples/poolparty.rb", "examples/with_apache_plugin.rb", "generators/poolspec/USAGE", "generators/poolspec/poolspec_generator.rb", "generators/poolspec/templates/pool_spec_template.erb", "lib/erlang/eb_server.erl", "lib/poolparty.rb", "lib/poolparty/base_packages/haproxy.rb", "lib/poolparty/base_packages/heartbeat.rb", "lib/poolparty/base_packages/poolparty.rb", "lib/poolparty/base_packages/ruby.rb", "lib/poolparty/core/array.rb", "lib/poolparty/core/exception.rb", "lib/poolparty/core/float.rb", "lib/poolparty/core/hash.rb", "lib/poolparty/core/kernel.rb", "lib/poolparty/core/module.rb", "lib/poolparty/core/my_open_struct.rb", "lib/poolparty/core/object.rb", "lib/poolparty/core/proc.rb", "lib/poolparty/core/string.rb", "lib/poolparty/core/symbol.rb", "lib/poolparty/core/time.rb", "lib/poolparty/exceptions/RemoteException.rb", "lib/poolparty/exceptions/ResourceException.rb", "lib/poolparty/exceptions/RuntimeException.rb", "lib/poolparty/exceptions/SpecException.rb", "lib/poolparty/exceptions/TemplateNotFound.rb", "lib/poolparty/helpers/binary.rb", "lib/poolparty/helpers/console.rb", "lib/poolparty/helpers/display.rb", "lib/poolparty/helpers/optioner.rb", "lib/poolparty/helpers/provisioner_base.rb", "lib/poolparty/helpers/provisioners/master.rb", "lib/poolparty/helpers/provisioners/slave.rb", "lib/poolparty/modules/cloud_resourcer.rb", "lib/poolparty/modules/configurable.rb", "lib/poolparty/modules/definable_resource.rb", "lib/poolparty/modules/file_writer.rb", "lib/poolparty/modules/method_missing_sugar.rb", "lib/poolparty/modules/output.rb", "lib/poolparty/modules/pretty_printer.rb", "lib/poolparty/modules/s3_string.rb", "lib/poolparty/modules/safe_instance.rb", "lib/poolparty/monitors/base_monitor.rb", "lib/poolparty/net/remote.rb", "lib/poolparty/net/remote_bases/ec2.rb", "lib/poolparty/net/remote_instance.rb", "lib/poolparty/net/remoter.rb", "lib/poolparty/net/remoter_base.rb", "lib/poolparty/plugins/gem_package.rb", "lib/poolparty/plugins/git.rb", "lib/poolparty/plugins/line.rb", "lib/poolparty/plugins/svn.rb", "lib/poolparty/pool/base.rb", "lib/poolparty/pool/cloud.rb", "lib/poolparty/pool/custom_resource.rb", "lib/poolparty/pool/loggable.rb", "lib/poolparty/pool/plugin.rb", "lib/poolparty/pool/plugin_model.rb", "lib/poolparty/pool/pool.rb", "lib/poolparty/pool/resource.rb", "lib/poolparty/pool/resources/class_package.rb", "lib/poolparty/pool/resources/conditional.rb", "lib/poolparty/pool/resources/cron.rb", "lib/poolparty/pool/resources/directory.rb", "lib/poolparty/pool/resources/exec.rb", "lib/poolparty/pool/resources/file.rb", "lib/poolparty/pool/resources/gem.rb", "lib/poolparty/pool/resources/host.rb", "lib/poolparty/pool/resources/package.rb", "lib/poolparty/pool/resources/remote_file.rb", "lib/poolparty/pool/resources/service.rb", "lib/poolparty/pool/resources/sshkey.rb", "lib/poolparty/pool/resources/symlink.rb", "lib/poolparty/pool/resources/variable.rb", "lib/poolparty/pool/script.rb", "lib/poolparty/puppet_plugins/poolparty/plugins/puppet/parser/functions/activenodeips.rb", "lib/poolparty/puppet_plugins/poolparty/plugins/puppet/parser/functions/activenodenames.rb", "lib/poolparty/templates/authkeys", "lib/poolparty/templates/cib.xml", "lib/poolparty/templates/fileserver.conf", "lib/poolparty/templates/gem", "lib/poolparty/templates/ha.cf", "lib/poolparty/templates/haproxy.conf", "lib/poolparty/templates/haresources", "lib/poolparty/templates/namespaceauth.conf", "lib/poolparty/templates/poolparty.monitor", "lib/poolparty/templates/puppet.conf", "lib/poolparty/version.rb", "lib/poolpartycl.rb", "poolparty.gemspec", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "spec/poolparty/base_packages/haproxy_spec.rb", "spec/poolparty/base_packages/heartbeat_spec.rb", "spec/poolparty/bin/console_spec.rb", "spec/poolparty/core/array_spec.rb", "spec/poolparty/core/float.rb", "spec/poolparty/core/hash_spec.rb", "spec/poolparty/core/kernel_spec.rb", "spec/poolparty/core/module_spec.rb", "spec/poolparty/core/object_spec.rb", "spec/poolparty/core/string_spec.rb", "spec/poolparty/core/time_spec.rb", "spec/poolparty/helpers/binary_spec.rb", "spec/poolparty/helpers/display_spec.rb", "spec/poolparty/helpers/optioner_spec.rb", "spec/poolparty/helpers/provisioner_base_spec.rb", "spec/poolparty/helpers/provisioners/master_spec.rb", "spec/poolparty/helpers/provisioners/slave_spec.rb", "spec/poolparty/modules/cloud_resourcer_spec.rb", "spec/poolparty/modules/configurable_spec.rb", "spec/poolparty/modules/definable_resource.rb", "spec/poolparty/modules/file_writer_spec.rb", "spec/poolparty/modules/s3_string_spec.rb", "spec/poolparty/net/remote_bases/ec2_spec.rb", "spec/poolparty/net/remote_instance_spec.rb", "spec/poolparty/net/remote_spec.rb", "spec/poolparty/net/remoter_base_spec.rb", "spec/poolparty/net/remoter_spec.rb", "spec/poolparty/plugins/git_spec.rb", "spec/poolparty/plugins/line_spec.rb", "spec/poolparty/plugins/svn_spec.rb", "spec/poolparty/pool/base_spec.rb", "spec/poolparty/pool/cloud_spec.rb", "spec/poolparty/pool/configurers/files/ruby_basic.rb", "spec/poolparty/pool/configurers/files/ruby_plugins.rb", "spec/poolparty/pool/configurers/ruby_spec.rb", "spec/poolparty/pool/custom_resource_spec.rb", "spec/poolparty/pool/example_spec.rb", "spec/poolparty/pool/plugin_model_spec.rb", "spec/poolparty/pool/plugin_spec.rb", "spec/poolparty/pool/pool_spec.rb", "spec/poolparty/pool/resource_spec.rb", "spec/poolparty/pool/resources/class_package_spec.rb", "spec/poolparty/pool/resources/conditional_spec.rb", "spec/poolparty/pool/resources/cron_spec.rb", "spec/poolparty/pool/resources/directory_spec.rb", "spec/poolparty/pool/resources/exec_spec.rb", "spec/poolparty/pool/resources/file_spec.rb", "spec/poolparty/pool/resources/gem_spec.rb", "spec/poolparty/pool/resources/host_spec.rb", "spec/poolparty/pool/resources/package_spec.rb", "spec/poolparty/pool/resources/remote_file_spec.rb", "spec/poolparty/pool/resources/service_spec.rb", "spec/poolparty/pool/resources/sshkey_spec.rb", "spec/poolparty/pool/resources/symlink_spec.rb", "spec/poolparty/pool/resources/variable_spec.rb", "spec/poolparty/pool/script_spec.rb", "spec/poolparty/pool/test_plugins/sshkey_test", "spec/poolparty/pool/test_plugins/virtual_host_template.erb", "spec/poolparty/pool/test_plugins/webserver.rb", "spec/poolparty/poolparty_spec.rb", "spec/poolparty/spec_helper.rb", "tasks/cloud.rake", "tasks/deployment.rake", "tasks/development.rake", "tasks/ec2.rake", "tasks/environment.rake", "tasks/instance.rake", "tasks/server.rake", "tasks/spec.rake", "tasks/website.rake", "test/test_generator_helper.rb", "test/test_helper.rb", "test/test_pool_spec_generator.rb", "test/test_poolparty.rb", "test_manifest.pp", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/code.css", "website/stylesheets/screen.css", "website/template.html.erb"]
12
+ s.files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "bin/cloud", "bin/cloud-add-keypair", "bin/cloud-configure", "bin/cloud-contract", "bin/cloud-expand", "bin/cloud-list", "bin/cloud-maintain", "bin/cloud-osxcopy", "bin/cloud-provision", "bin/cloud-refresh", "bin/cloud-ssh", "bin/cloud-start", "bin/cloud-terminate", "bin/pool", "bin/pool-console", "bin/pool-describe", "bin/pool-list", "bin/pool-provision", "bin/pool-spec", "bin/pool-start", "bin/pool-start-monitor", "bin/server-get-load", "bin/server-list-active", "bin/server-rerun", "config/hoe.rb", "config/requirements.rb", "examples/basic.rb", "examples/plugin_without_plugin_directory.rb", "examples/poolparty.rb", "examples/with_apache_plugin.rb", "generators/poolspec/USAGE", "generators/poolspec/poolspec_generator.rb", "generators/poolspec/templates/pool_spec_template.erb", "lib/erlang/messenger/Makefile", "lib/erlang/messenger/README", "lib/erlang/messenger/Rakefile", "lib/erlang/messenger/control", "lib/erlang/messenger/ebin/erl_crash.dump", "lib/erlang/messenger/ebin/load_app.beam", "lib/erlang/messenger/ebin/pm_cluster.beam", "lib/erlang/messenger/ebin/pm_master.beam", "lib/erlang/messenger/ebin/pm_master_supervisor.beam", "lib/erlang/messenger/ebin/pm_node.beam", "lib/erlang/messenger/ebin/pm_node_supervisor.beam", "lib/erlang/messenger/ebin/tmp/templates/apache2.conf", "lib/erlang/messenger/ebin/tmp/templates/base.conf.erb", "lib/erlang/messenger/ebin/tmp/templates/browser_fixes.conf.erb", "lib/erlang/messenger/ebin/tmp/templates/mime-minimal.conf.erb", "lib/erlang/messenger/ebin/tmp/templates/virtual_host.conf.erb", "lib/erlang/messenger/lib/load_app.app", "lib/erlang/messenger/src/load_app.erl", "lib/erlang/messenger/src/pm_cluster.erl", "lib/erlang/messenger/src/pm_master.erl", "lib/erlang/messenger/src/pm_master_supervisor.erl", "lib/erlang/messenger/src/pm_node.erl", "lib/erlang/messenger/src/pm_node_supervisor.erl", "lib/poolparty.rb", "lib/poolparty/base_packages/haproxy.rb", "lib/poolparty/base_packages/heartbeat.rb", "lib/poolparty/base_packages/poolparty.rb", "lib/poolparty/base_packages/ruby.rb", "lib/poolparty/core/array.rb", "lib/poolparty/core/exception.rb", "lib/poolparty/core/float.rb", "lib/poolparty/core/hash.rb", "lib/poolparty/core/kernel.rb", "lib/poolparty/core/module.rb", "lib/poolparty/core/my_open_struct.rb", "lib/poolparty/core/object.rb", "lib/poolparty/core/proc.rb", "lib/poolparty/core/string.rb", "lib/poolparty/core/symbol.rb", "lib/poolparty/core/time.rb", "lib/poolparty/dependency_resolutions/base.rb", "lib/poolparty/dependency_resolutions/puppet.rb", "lib/poolparty/exceptions/RemoteException.rb", "lib/poolparty/exceptions/ResourceException.rb", "lib/poolparty/exceptions/RuntimeException.rb", "lib/poolparty/exceptions/SpecException.rb", "lib/poolparty/exceptions/TemplateNotFound.rb", "lib/poolparty/helpers/binary.rb", "lib/poolparty/helpers/console.rb", "lib/poolparty/helpers/display.rb", "lib/poolparty/helpers/optioner.rb", "lib/poolparty/helpers/provisioner_base.rb", "lib/poolparty/helpers/provisioners/master.rb", "lib/poolparty/helpers/provisioners/slave.rb", "lib/poolparty/modules/cloud_resourcer.rb", "lib/poolparty/modules/configurable.rb", "lib/poolparty/modules/definable_resource.rb", "lib/poolparty/modules/file_writer.rb", "lib/poolparty/modules/method_missing_sugar.rb", "lib/poolparty/modules/output.rb", "lib/poolparty/modules/pretty_printer.rb", "lib/poolparty/modules/resourcing_dsl.rb", "lib/poolparty/modules/s3_string.rb", "lib/poolparty/modules/safe_instance.rb", "lib/poolparty/monitors/base_monitor.rb", "lib/poolparty/monitors/monitors/cpu_monitor.rb", "lib/poolparty/monitors/monitors/memory_monitor.rb", "lib/poolparty/net/remote.rb", "lib/poolparty/net/remote_bases/ec2.rb", "lib/poolparty/net/remote_instance.rb", "lib/poolparty/net/remoter.rb", "lib/poolparty/net/remoter_base.rb", "lib/poolparty/plugins/git.rb", "lib/poolparty/plugins/line.rb", "lib/poolparty/plugins/svn.rb", "lib/poolparty/pool/base.rb", "lib/poolparty/pool/cloud.rb", "lib/poolparty/pool/custom_resource.rb", "lib/poolparty/pool/loggable.rb", "lib/poolparty/pool/plugin.rb", "lib/poolparty/pool/plugin_model.rb", "lib/poolparty/pool/pool.rb", "lib/poolparty/pool/resource.rb", "lib/poolparty/pool/resources/class_package.rb", "lib/poolparty/pool/resources/conditional.rb", "lib/poolparty/pool/resources/cron.rb", "lib/poolparty/pool/resources/directory.rb", "lib/poolparty/pool/resources/exec.rb", "lib/poolparty/pool/resources/file.rb", "lib/poolparty/pool/resources/gem.rb", "lib/poolparty/pool/resources/host.rb", "lib/poolparty/pool/resources/package.rb", "lib/poolparty/pool/resources/remote_file.rb", "lib/poolparty/pool/resources/service.rb", "lib/poolparty/pool/resources/sshkey.rb", "lib/poolparty/pool/resources/symlink.rb", "lib/poolparty/pool/resources/variable.rb", "lib/poolparty/pool/script.rb", "lib/poolparty/templates/authkeys", "lib/poolparty/templates/cib.xml", "lib/poolparty/templates/fileserver.conf", "lib/poolparty/templates/gem", "lib/poolparty/templates/ha.cf", "lib/poolparty/templates/haproxy.conf", "lib/poolparty/templates/haresources", "lib/poolparty/templates/namespaceauth.conf", "lib/poolparty/templates/poolparty.monitor", "lib/poolparty/templates/puppet.conf", "lib/poolparty/version.rb", "lib/poolpartycl.rb", "poolparty.gemspec", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "spec/poolparty/base_packages/haproxy_spec.rb", "spec/poolparty/base_packages/heartbeat_spec.rb", "spec/poolparty/bin/console_spec.rb", "spec/poolparty/core/array_spec.rb", "spec/poolparty/core/float.rb", "spec/poolparty/core/hash_spec.rb", "spec/poolparty/core/kernel_spec.rb", "spec/poolparty/core/module_spec.rb", "spec/poolparty/core/object_spec.rb", "spec/poolparty/core/string_spec.rb", "spec/poolparty/core/time_spec.rb", "spec/poolparty/dependency_resolutions/base_spec.rb", "spec/poolparty/helpers/binary_spec.rb", "spec/poolparty/helpers/display_spec.rb", "spec/poolparty/helpers/optioner_spec.rb", "spec/poolparty/helpers/provisioner_base_spec.rb", "spec/poolparty/helpers/provisioners/master_spec.rb", "spec/poolparty/helpers/provisioners/slave_spec.rb", "spec/poolparty/modules/cloud_resourcer_spec.rb", "spec/poolparty/modules/configurable_spec.rb", "spec/poolparty/modules/definable_resource.rb", "spec/poolparty/modules/file_writer_spec.rb", "spec/poolparty/modules/s3_string_spec.rb", "spec/poolparty/monitors/base_monitor_spec.rb", "spec/poolparty/monitors/monitors/cpu_monitor_spec.rb", "spec/poolparty/net/remote_bases/ec2_spec.rb", "spec/poolparty/net/remote_instance_spec.rb", "spec/poolparty/net/remote_spec.rb", "spec/poolparty/net/remoter_base_spec.rb", "spec/poolparty/net/remoter_spec.rb", "spec/poolparty/plugins/git_spec.rb", "spec/poolparty/plugins/line_spec.rb", "spec/poolparty/plugins/svn_spec.rb", "spec/poolparty/pool/base_spec.rb", "spec/poolparty/pool/cloud_spec.rb", "spec/poolparty/pool/configurers/files/ruby_basic.rb", "spec/poolparty/pool/configurers/files/ruby_plugins.rb", "spec/poolparty/pool/configurers/ruby_spec.rb", "spec/poolparty/pool/custom_resource_spec.rb", "spec/poolparty/pool/example_spec.rb", "spec/poolparty/pool/plugin_model_spec.rb", "spec/poolparty/pool/plugin_spec.rb", "spec/poolparty/pool/pool_spec.rb", "spec/poolparty/pool/resource_spec.rb", "spec/poolparty/pool/resources/class_package_spec.rb", "spec/poolparty/pool/resources/conditional_spec.rb", "spec/poolparty/pool/resources/cron_spec.rb", "spec/poolparty/pool/resources/directory_spec.rb", "spec/poolparty/pool/resources/exec_spec.rb", "spec/poolparty/pool/resources/file_spec.rb", "spec/poolparty/pool/resources/gem_spec.rb", "spec/poolparty/pool/resources/host_spec.rb", "spec/poolparty/pool/resources/package_spec.rb", "spec/poolparty/pool/resources/remote_file_spec.rb", "spec/poolparty/pool/resources/service_spec.rb", "spec/poolparty/pool/resources/sshkey_spec.rb", "spec/poolparty/pool/resources/symlink_spec.rb", "spec/poolparty/pool/resources/variable_spec.rb", "spec/poolparty/pool/script_spec.rb", "spec/poolparty/pool/test_plugins/sshkey_test", "spec/poolparty/pool/test_plugins/virtual_host_template.erb", "spec/poolparty/pool/test_plugins/webserver.rb", "spec/poolparty/poolparty_spec.rb", "spec/poolparty/spec_helper.rb", "tasks/cloud.rake", "tasks/deployment.rake", "tasks/development.rake", "tasks/ec2.rake", "tasks/environment.rake", "tasks/instance.rake", "tasks/server.rake", "tasks/spec.rake", "tasks/website.rake", "test/test_generator_helper.rb", "test/test_helper.rb", "test/test_pool_spec_generator.rb", "test/test_poolparty.rb", "test_manifest.pp", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/code.css", "website/stylesheets/screen.css", "website/template.html.erb"]
13
13
  s.has_rdoc = true
14
14
  s.homepage = %q{http://poolparty.rubyforge.org}
15
15
  s.post_install_message = %q{Get ready to jump in the pool, you just installed poolpartyrb!
@@ -21,7 +21,9 @@ To get started, run the generator:
21
21
  Please check out the documentation for any questions or check out the google groups at
22
22
  http://groups.google.com/group/poolpartyrb
23
23
 
24
- Don't forget to check out the plugin tutorial @ http://poolpartyrb.com for extending PoolParty!
24
+ Tutorials are at http://poolpartyrb.com
25
+
26
+ Don't forget to check out the plugin tutorial @ http://poolpartyrb.com to extend PoolParty for your needs!
25
27
 
26
28
  For more information, check http://PoolPartyrb.com
27
29
  On IRC:
data/setup.rb CHANGED
@@ -1363,7 +1363,7 @@ class Installer
1363
1363
 
1364
1364
  def install_dir_conf(rel)
1365
1365
  # FIXME: should not remove current config files
1366
- # (rename previous file to .old/.org)
1366
+ # (rename preious file to .old/.org)
1367
1367
  install_files targetfiles(), "#{config('sysconfdir')}/#{rel}", 0644
1368
1368
  end
1369
1369
 
@@ -1542,12 +1542,12 @@ class Installer
1542
1542
 
1543
1543
  dir = File.basename(rel)
1544
1544
  Dir.mkdir dir unless File.dir?(dir)
1545
- prevdir = Dir.pwd
1545
+ predir = Dir.pwd
1546
1546
  Dir.chdir dir
1547
1547
  $stderr.puts '---> ' + rel if verbose?
1548
1548
  @currdir = rel
1549
1549
  yield
1550
- Dir.chdir prevdir
1550
+ Dir.chdir predir
1551
1551
  $stderr.puts '<--- ' + rel if verbose?
1552
1552
  @currdir = File.dirname(rel)
1553
1553
  end
@@ -30,7 +30,7 @@ describe "Hash" do
30
30
  it "should be able to flush out into a string into an array" do
31
31
  @a.flush_out.should == ["a => '10'","b => '20'","c => '30'"]
32
32
  end
33
- it "should be able to flush out with prev and posts" do
33
+ it "should be able to flush out with pre and posts" do
34
34
  @a.flush_out("hi", "ho").should == ["hia => '10'ho","hib => '20'ho","hic => '30'ho"]
35
35
  end
36
36
  describe "select" do
@@ -60,4 +60,22 @@ describe "Hash" do
60
60
  }.should_not raise_error
61
61
  end
62
62
  end
63
+ describe "append" do
64
+ before(:each) do
65
+ @hash = {:game => "token", :required => "for_play"}
66
+ end
67
+ it "should not destroy an option salready on the hash" do
68
+ @hash.append(:required => "to_play")[:game].should == "token"
69
+ end
70
+ it "should change the entry to an array if it already exists" do
71
+ @hash.append(:game => "coin")[:game].class.should == Array
72
+ end
73
+ it "should append the other hash's key to the end of the array" do
74
+ @hash.append(:game => "coin")[:game][-1].should == "coin"
75
+ end
76
+ it "should change the hash with the append(bang) option" do
77
+ @hash.append!(:game => "coin")
78
+ @hash[:game][-1].should == "coin"
79
+ end
80
+ end
63
81
  end
@@ -0,0 +1,11 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe "Resolution spec" do
4
+ before(:each) do
5
+ @base = Class.new
6
+ @base.extend(DependencyResolutions::Base)
7
+ end
8
+ %w(to_s to_string).each do |meth|
9
+ eval "it 'should have the method #{meth} defined' do; @base.respond_to?(:#{meth}).should == true; end"
10
+ end
11
+ end
@@ -43,6 +43,15 @@ describe "FileWriter" do
43
43
  @test.write_to_file_in_storage_directory(@filepath, "STRING TO WRITE")
44
44
  end
45
45
  end
46
+ describe "trying to copy the same file" do
47
+ before(:each) do
48
+ @filepath = @path
49
+ end
50
+ it "should not try to copy a file if they are the same file" do
51
+ FileUtils.should_not_receive(:cp)
52
+ @test.copy_file_to_storage_directory(@filepath)
53
+ end
54
+ end
46
55
  after(:all) do
47
56
  ::File.unlink @path if ::File.file? @path
48
57
  end
@@ -0,0 +1,19 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ include PoolParty::Monitors
4
+
5
+ describe "Monitors" do
6
+ it "should have a list of available monitors" do
7
+ PoolParty::Monitors.available_monitors.empty?.should == false
8
+ end
9
+ it "should register a module and append it to the available monitors" do
10
+ size = PoolParty::Monitors.available_monitors.size
11
+ PoolParty::Monitors.register_monitor :fake
12
+ size.should == PoolParty::Monitors.available_monitors.size - 1
13
+ end
14
+ end
15
+ describe "BaseMonitor" do
16
+ it "should have the singleton method run defined" do
17
+ BaseMonitor.respond_to?(:run).should == true
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ include PoolParty::Monitors
4
+
5
+ describe "CpuMonitor" do
6
+ before(:each) do
7
+ @mon = CpuMonitor.new
8
+ CpuMonitor.stub!(:new).and_return @mon
9
+ end
10
+ it "should have the singleton method run defined" do
11
+ CpuMonitor.respond_to?(:run).should == true
12
+ end
13
+ it "should call the method new" do
14
+ CpuMonitor.should_receive(:new).and_return @mon
15
+ CpuMonitor.run
16
+ end
17
+ end
@@ -65,6 +65,11 @@ describe "Remote Instance" do
65
65
  @ri.responding.should_not be_nil
66
66
  @ri.responding?.should == true
67
67
  end
68
-
68
+ it "should have the puppet_runner_command" do
69
+ @ri.respond_to?(:puppet_runner_command).should == true
70
+ end
71
+ it "should return the puppet_runner_command with puppetd" do
72
+ @ri.puppet_runner_command.should =~ /puppetd/
73
+ end
69
74
  end
70
75
  end
@@ -48,7 +48,7 @@ describe "Remoter" do
48
48
  @tc.rsync_command.should == "rsync --delete -azP --exclude cache -e '#{@tc.ssh_string}'"
49
49
  end
50
50
  it "should be able to rsync storage commands" do
51
- @tc.rsync_storage_files_to_command(@ri).should == "#{@tc.rsync_command} #{Dir.pwd}/tmp 192.168.0.22:/var/poolparty"
51
+ @tc.rsync_storage_files_to_command(@ri).should == "#{@tc.rsync_command} #{Dir.pwd}/tmp/ 192.168.0.22:/var/poolparty"
52
52
  end
53
53
  end
54
54
  describe "launch_and_configure_master!" do
@@ -188,4 +188,5 @@ describe "Remoter" do
188
188
  end
189
189
  end
190
190
  end
191
+
191
192
  end
@@ -170,7 +170,7 @@ describe "Cloud" do
170
170
  hello my lady
171
171
  EOE
172
172
  end
173
- has_gem(:name => "poolparty")
173
+ has_gempackage(:name => "poolparty")
174
174
  has_package(:name => "dummy")
175
175
  end
176
176
  end
@@ -310,5 +310,19 @@ describe "Cloud" do
310
310
  end
311
311
  end
312
312
 
313
+ describe "provisioning" do
314
+ it "should be able to tell that it is provisioning when setting the provisioning flag" do
315
+ @cloud.provisioning?.should == false
316
+ end
317
+ it "should be able to set it as provisioning" do
318
+ @cloud.provisioning_in_progress
319
+ @cloud.provisioning?.should == true
320
+ end
321
+ it "should be able to unset itself as provisioning" do
322
+ @cloud.provisioning_in_progress
323
+ @cloud.provisioning_complete
324
+ @cloud.provisioning?.should == false
325
+ end
326
+ end
313
327
  end
314
328
  end
@@ -80,10 +80,10 @@ describe "Custom Resource" do
80
80
  end
81
81
  it "should create a new CallFunction instance when calling call_function with a string" do
82
82
  PoolParty::Resources::CallFunction.should_receive(:new).and_return "bunk"
83
- add_resource(:call_function, "line")
83
+ add_resource(:call_function, :name => "line")
84
84
  end
85
85
  it "should create a call function in the function call array" do
86
- add_resource(:call_function, @cloud, "heyyohey")
86
+ add_resource(:call_function, {:name => "custom_function"}, @cloud)
87
87
  resource(:call_function).size.should == 1
88
88
  end
89
89
  describe "defining" do
@@ -39,7 +39,7 @@ describe "Plugin" do
39
39
  before(:each) do
40
40
  @plugin.instance_eval do
41
41
  enable_php
42
- has_gem(:name => "aska")
42
+ has_gempackage(:name => "aska")
43
43
  end
44
44
  end
45
45
  it "should call enable_php on the class" do
@@ -49,13 +49,13 @@ describe "Plugin" do
49
49
  @plugin.resources.class.should == Hash
50
50
  end
51
51
  it "should have an array of gem resources" do
52
- @plugin.resource(:package).class.should == Array
52
+ @plugin.resource(:gempackage).class.should == Array
53
53
  end
54
54
  it "should have 1 gem in the resources defined" do
55
- @plugin.resource(:package).size.should == 1
55
+ @plugin.resource(:gempackage).size.should == 1
56
56
  end
57
57
  it "should have the gem named aska in the gem resource" do
58
- @plugin.resource(:package).first.name.should == "aska"
58
+ @plugin.resource(:gempackage).first.name.should == "aska"
59
59
  end
60
60
  it "should have its resources visible to its parent" do
61
61
  @plugin.parent = @c
@@ -131,6 +131,13 @@ describe "Resource" do
131
131
  include PoolParty::Resources
132
132
  before(:each) do
133
133
  reset_resources!
134
+ @cloud = cloud :command_cloud do; end
135
+ end
136
+ it "should call add_resource when creating using the command: file" do
137
+ @cloud.should_receive(:add_resource).with(:file, {:name => "frank"}, @cloud)
138
+ @cloud.instance_eval do
139
+ file(:name => "frank")
140
+ end
134
141
  end
135
142
  it "should create the new 'resource' as a resource" do
136
143
  resource(:file).class.should == Array
@@ -220,6 +227,29 @@ describe "Resource" do
220
227
  @file.parent.tangerine.should == "orange"
221
228
  end
222
229
  end
230
+ describe "appending to resource" do
231
+ before(:each) do
232
+ @cloud1 = cloud :apples do
233
+ directory(:name => "/var/www") do
234
+ file(:name => "/var/www/file.html")
235
+ end
236
+ end
237
+ @dir = @cloud1.get_resource(:directory, "/var/www")
238
+ @file = @dir.get_resource(:file, "/var/www/file.html")
239
+ end
240
+ it "should say there is 1 resource because the lower-level resources should be contained on the parenting resource" do
241
+ @cloud1.resources.size.should == 1
242
+ end
243
+ it "should say there is one resource on the outer resource" do
244
+ @dir.resources.size.should == 1
245
+ end
246
+ it "should contain the file as a resource" do
247
+ @dir.resource(:file)[0].to_s.should == @file.to_s
248
+ end
249
+ it "should set the parent as the parenting resource" do
250
+ @file.parent.to_s.should == @dir.to_s
251
+ end
252
+ end
223
253
  describe "fetching" do
224
254
  before(:each) do
225
255
  @file = file(:name => "pancakes")
@@ -228,7 +258,7 @@ describe "Resource" do
228
258
  PoolParty::Resources::File.should_not_receive(:new)
229
259
  file(:name => "pancakes")
230
260
  end
231
- it "should return the file previously created" do
261
+ it "should return the file preiously created" do
232
262
  get_resource(:file, "pancakes").should == @file
233
263
  end
234
264
  it "should be able to use the helper to grab the file" do
@@ -247,6 +277,14 @@ describe "Resource" do
247
277
  @file.cancelled?.should == true
248
278
  end
249
279
  end
280
+ describe "virtual_resources" do
281
+ before(:each) do
282
+ @virtual_resource = git(:name => "tank", :source => "git://github.com/auser/testgit.git")
283
+ end
284
+ it "should fetch a virtual resource the same" do
285
+ git(:name => "tank", :source => "git://github.com/auser/testgit.git").to_s.should == @virtual_resource.to_s
286
+ end
287
+ end
250
288
  end
251
289
  end
252
290
  end