poolparty 0.2.69 → 0.2.84

Sign up to get free protection for your applications and to get access to all the features.
Files changed (298) hide show
  1. data/Capfile +1 -0
  2. data/History.txt +6 -0
  3. data/Manifest.txt +140 -143
  4. data/PostInstall.txt +1 -1
  5. data/README.txt +2 -0
  6. data/bin/cloud-configure +5 -2
  7. data/bin/cloud-handle-load +3 -3
  8. data/bin/cloud-maintain +3 -3
  9. data/bin/cloud-provision +6 -5
  10. data/bin/cloud-rsync +28 -0
  11. data/bin/cloud-setup-dev +25 -0
  12. data/bin/cloud-spec +40 -0
  13. data/bin/cloud-start +5 -3
  14. data/bin/server-clean-cert-for +15 -0
  15. data/bin/server-rerun +0 -1
  16. data/bin/server-start-client +1 -1
  17. data/bin/server-start-master +1 -1
  18. data/bin/server-start-node +1 -1
  19. data/bin/server-update-hosts +4 -3
  20. data/bin/server-write-new-nodes +26 -0
  21. data/generators/poolspec/USAGE +2 -2
  22. data/generators/poolspec/poolspec_generator.rb +1 -1
  23. data/lib/erlang/messenger/Makefile +15 -0
  24. data/lib/erlang/messenger/ebin/client_app.beam +0 -0
  25. data/lib/erlang/messenger/ebin/client_server.beam +0 -0
  26. data/lib/erlang/messenger/ebin/erl_crash.dump +10326 -0
  27. data/lib/erlang/messenger/ebin/master_app.beam +0 -0
  28. data/lib/erlang/messenger/ebin/node_app.beam +0 -0
  29. data/lib/erlang/messenger/ebin/pm_client.beam +0 -0
  30. data/lib/erlang/messenger/ebin/pm_client_old.beam +0 -0
  31. data/lib/erlang/messenger/ebin/pm_client_supervisor.beam +0 -0
  32. data/lib/erlang/messenger/ebin/pm_cluster.beam +0 -0
  33. data/lib/erlang/messenger/ebin/pm_event_manager.beam +0 -0
  34. data/lib/erlang/messenger/ebin/pm_master.beam +0 -0
  35. data/lib/erlang/messenger/ebin/pm_master_event_handler.beam +0 -0
  36. data/lib/erlang/messenger/ebin/pm_master_supervisor.beam +0 -0
  37. data/lib/erlang/messenger/ebin/pm_node.beam +0 -0
  38. data/lib/erlang/messenger/ebin/pm_node_supervisor.beam +0 -0
  39. data/lib/erlang/messenger/ebin/pm_packager.beam +0 -0
  40. data/lib/erlang/messenger/ebin/pm_spawner.beam +0 -0
  41. data/lib/erlang/messenger/ebin/pm_strings.beam +0 -0
  42. data/lib/erlang/messenger/ebin/utils.beam +0 -0
  43. data/lib/erlang/messenger/lib/eunit/Makefile +28 -0
  44. data/lib/erlang/messenger/lib/eunit/ebin/autoload.beam +0 -0
  45. data/lib/erlang/messenger/lib/eunit/ebin/code_monitor.beam +0 -0
  46. data/lib/erlang/messenger/lib/eunit/ebin/eunit.beam +0 -0
  47. data/lib/erlang/messenger/lib/eunit/ebin/eunit_autoexport.beam +0 -0
  48. data/lib/erlang/messenger/lib/eunit/ebin/eunit_data.beam +0 -0
  49. data/lib/erlang/messenger/lib/eunit/ebin/eunit_lib.beam +0 -0
  50. data/lib/erlang/messenger/lib/eunit/ebin/eunit_proc.beam +0 -0
  51. data/lib/erlang/messenger/lib/eunit/ebin/eunit_serial.beam +0 -0
  52. data/lib/erlang/messenger/lib/eunit/ebin/eunit_server.beam +0 -0
  53. data/lib/erlang/messenger/lib/eunit/ebin/eunit_striptests.beam +0 -0
  54. data/lib/erlang/messenger/lib/eunit/ebin/eunit_test.beam +0 -0
  55. data/lib/erlang/messenger/lib/eunit/ebin/eunit_tests.beam +0 -0
  56. data/lib/erlang/messenger/lib/eunit/ebin/eunit_tty.beam +0 -0
  57. data/lib/erlang/messenger/lib/eunit/ebin/file_monitor.beam +0 -0
  58. data/lib/erlang/messenger/lib/eunit/src/Makefile +46 -0
  59. data/lib/erlang/messenger/src/pm_master.erl +5 -0
  60. data/lib/erlang/messenger/src/pm_node.erl +2 -3
  61. data/lib/erlang/messenger/src/pm_spawner.erl +213 -0
  62. data/lib/poolparty/base_packages/heartbeat.rb +57 -43
  63. data/lib/poolparty/base_packages/poolparty.rb +18 -15
  64. data/lib/poolparty/capistrano.rb +18 -0
  65. data/lib/poolparty/core/class.rb +24 -0
  66. data/lib/poolparty/core/kernel.rb +7 -0
  67. data/lib/poolparty/core/module.rb +2 -2
  68. data/lib/poolparty/core/string.rb +1 -1
  69. data/lib/poolparty/dependency_resolutions/puppet.rb +10 -2
  70. data/lib/poolparty/exceptions/ProvisionerException.rb +5 -0
  71. data/lib/poolparty/extra/deployments.rb +31 -0
  72. data/lib/poolparty/helpers/binary.rb +14 -2
  73. data/lib/poolparty/helpers/optioner.rb +61 -22
  74. data/lib/poolparty/helpers/ruberl.rb +33 -0
  75. data/lib/poolparty/modules/cloud_dsl.rb +2 -1
  76. data/lib/poolparty/modules/cloud_resourcer.rb +30 -6
  77. data/lib/poolparty/modules/configurable.rb +2 -0
  78. data/lib/poolparty/modules/file_writer.rb +4 -4
  79. data/lib/poolparty/modules/resourcing_dsl.rb +5 -5
  80. data/lib/poolparty/monitors/base_monitor.rb +1 -1
  81. data/lib/poolparty/monitors/monitors/cpu_monitor.rb +2 -2
  82. data/lib/poolparty/net/messenger.rb +1 -1
  83. data/lib/poolparty/net/remote.rb +2 -2
  84. data/lib/poolparty/net/remote_bases/ec2.rb +51 -11
  85. data/lib/poolparty/net/remote_instance.rb +7 -3
  86. data/lib/poolparty/net/remoter.rb +72 -24
  87. data/lib/poolparty/net/remoter_base.rb +10 -0
  88. data/lib/poolparty/plugins/deploydirectory.rb +10 -5
  89. data/lib/poolparty/plugins/git.rb +51 -0
  90. data/lib/poolparty/{pool → poolparty}/base.rb +4 -2
  91. data/lib/poolparty/{pool → poolparty}/cloud.rb +32 -10
  92. data/lib/poolparty/{pool → poolparty}/plugin_model.rb +4 -4
  93. data/lib/poolparty/{pool → poolparty}/pool.rb +2 -2
  94. data/lib/poolparty/{pool → poolparty}/resource.rb +33 -15
  95. data/lib/poolparty/{pool → poolparty}/resources/class_package.rb +3 -3
  96. data/lib/poolparty/{pool → poolparty}/resources/directory.rb +6 -3
  97. data/lib/poolparty/{pool → poolparty}/resources/exec.rb +2 -5
  98. data/lib/poolparty/{pool → poolparty}/resources/file.rb +3 -3
  99. data/lib/poolparty/{pool → poolparty}/resources/package.rb +1 -1
  100. data/lib/poolparty/{pool → poolparty}/resources/remote_file.rb +1 -1
  101. data/lib/poolparty/poolparty/resources/remote_user.rb +17 -0
  102. data/lib/poolparty/{pool → poolparty}/resources/sshkey.rb +5 -1
  103. data/lib/poolparty/{pool → poolparty}/script.rb +1 -1
  104. data/lib/poolparty/provisioners/capistrano/capistrano.rb +127 -0
  105. data/lib/poolparty/provisioners/capistrano/capistrano_configurer.rb +58 -0
  106. data/lib/poolparty/provisioners/capistrano/recipies/base.rb +104 -0
  107. data/lib/poolparty/provisioners/capistrano/recipies/master.rb +121 -0
  108. data/lib/poolparty/provisioners/capistrano/recipies/slave.rb +12 -0
  109. data/lib/poolparty/provisioners/provisioner_base.rb +204 -0
  110. data/lib/poolparty/spec/core/string.rb +16 -0
  111. data/lib/poolparty/spec/matchers/a_spec_extensions_base.rb +26 -0
  112. data/lib/poolparty/spec/matchers/have_cron.rb +28 -0
  113. data/lib/poolparty/spec/matchers/have_deploydirectory.rb +15 -0
  114. data/lib/poolparty/spec/matchers/have_directory.rb +31 -0
  115. data/lib/poolparty/spec/matchers/have_exec.rb +28 -0
  116. data/lib/poolparty/spec/matchers/have_file.rb +28 -0
  117. data/lib/poolparty/spec/matchers/have_gempackage.rb +28 -0
  118. data/lib/poolparty/spec/matchers/have_git.rb +28 -0
  119. data/lib/poolparty/spec/matchers/have_host.rb +28 -0
  120. data/lib/poolparty/spec/matchers/have_mount.rb +28 -0
  121. data/lib/poolparty/spec/matchers/have_package.rb +28 -0
  122. data/lib/poolparty/spec/matchers/have_remotefile.rb +28 -0
  123. data/lib/poolparty/spec/matchers/have_rsyncmirror.rb +28 -0
  124. data/lib/poolparty/spec/matchers/have_service.rb +28 -0
  125. data/lib/poolparty/spec/matchers/have_sshkey.rb +28 -0
  126. data/lib/poolparty/spec/matchers/have_symlink.rb +28 -0
  127. data/lib/poolparty/spec/matchers/have_variable.rb +32 -0
  128. data/lib/poolparty/spec/spec/dynamic_matchers.rb +63 -0
  129. data/lib/poolparty/spec/spec/ensure_matchers_exist.rb +7 -0
  130. data/lib/poolparty/spec/templates/have_base.rb +28 -0
  131. data/lib/poolparty/templates/authkeys +1 -1
  132. data/lib/poolparty/templates/gem +12 -10
  133. data/lib/poolparty/templates/ha.cf +9 -11
  134. data/lib/poolparty/templates/haresources +1 -1
  135. data/lib/poolparty/templates/logd.cf +42 -0
  136. data/lib/poolparty/templates/puppet.conf +18 -8
  137. data/lib/poolparty/templates/puppetcleaner +9 -3
  138. data/lib/poolparty/templates/puppetrerun +16 -3
  139. data/lib/poolparty/templates/puppetrunner +1 -1
  140. data/lib/poolparty/version.rb +1 -1
  141. data/lib/poolparty.rb +12 -8
  142. data/lib/poolpartyspec.rb +34 -0
  143. data/poolparty.gemspec +151 -149
  144. data/spec/poolparty/aska/aska_spec.rb +0 -5
  145. data/spec/poolparty/bin/console_spec.rb +3 -0
  146. data/spec/poolparty/extra/deployments_spec.rb +64 -0
  147. data/spec/poolparty/helpers/binary_spec.rb +1 -1
  148. data/spec/poolparty/helpers/optioner_spec.rb +17 -4
  149. data/spec/poolparty/modules/cloud_resourcer_spec.rb +19 -2
  150. data/spec/poolparty/modules/configurable_spec.rb +2 -2
  151. data/spec/poolparty/net/remote_bases/ec2_spec.rb +5 -2
  152. data/spec/poolparty/net/remote_instance_spec.rb +5 -0
  153. data/spec/poolparty/net/remote_spec.rb +24 -31
  154. data/spec/poolparty/net/remoter_base_spec.rb +11 -6
  155. data/spec/poolparty/net/remoter_spec.rb +55 -27
  156. data/spec/poolparty/plugins/deploydirectory_spec.rb +1 -0
  157. data/spec/poolparty/plugins/git_spec.rb +45 -0
  158. data/spec/poolparty/{pool → poolparty}/cloud_spec.rb +41 -0
  159. data/spec/poolparty/{pool → poolparty}/plugin_spec.rb +1 -1
  160. data/spec/poolparty/{pool → poolparty}/pool_spec.rb +1 -1
  161. data/spec/poolparty/{pool → poolparty}/resource_spec.rb +15 -2
  162. data/spec/poolparty/poolparty/resources/user_spec.rb +38 -0
  163. data/spec/poolparty/poolparty/test_plugins/virtual_host_template.erb +0 -0
  164. data/spec/poolparty/poolparty_spec.rb +1 -1
  165. data/spec/poolparty/provisioners/capistrano/capistrano_spec.rb +27 -0
  166. data/spec/poolparty/provisioners/provisioner_base_spec.rb +120 -0
  167. data/spec/poolparty/spec/core/string_spec.rb +57 -0
  168. data/spec/poolparty/spec_helper.rb +48 -6
  169. data/tasks/deployment.rake +3 -5
  170. data/tasks/spec.rake +2 -3
  171. data/website/index.html +2 -2
  172. metadata +150 -148
  173. data/lib/erlang/messenger/lib/eunit/.svn/all-wcprops +0 -53
  174. data/lib/erlang/messenger/lib/eunit/.svn/entries +0 -140
  175. data/lib/erlang/messenger/lib/eunit/.svn/format +0 -1
  176. data/lib/erlang/messenger/lib/eunit/.svn/prop-base/NOTES.svn-base +0 -5
  177. data/lib/erlang/messenger/lib/eunit/.svn/text-base/AUTHORS.svn-base +0 -2
  178. data/lib/erlang/messenger/lib/eunit/.svn/text-base/CHANGELOG.svn-base +0 -14
  179. data/lib/erlang/messenger/lib/eunit/.svn/text-base/COPYING.svn-base +0 -504
  180. data/lib/erlang/messenger/lib/eunit/.svn/text-base/NOTES.svn-base +0 -276
  181. data/lib/erlang/messenger/lib/eunit/.svn/text-base/README.svn-base +0 -3
  182. data/lib/erlang/messenger/lib/eunit/.svn/text-base/sys.config.svn-base +0 -9
  183. data/lib/erlang/messenger/lib/eunit/.svn/text-base/vsn.mk.svn-base +0 -1
  184. data/lib/erlang/messenger/lib/eunit/doc/.svn/all-wcprops +0 -59
  185. data/lib/erlang/messenger/lib/eunit/doc/.svn/entries +0 -142
  186. data/lib/erlang/messenger/lib/eunit/doc/.svn/format +0 -1
  187. data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/erlang.png.svn-base +0 -5
  188. data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/eunit.html.svn-base +0 -5
  189. data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/index.html.svn-base +0 -5
  190. data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/modules-frame.html.svn-base +0 -5
  191. data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/overview-summary.html.svn-base +0 -5
  192. data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/packages-frame.html.svn-base +0 -5
  193. data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/edoc-info.svn-base +0 -3
  194. data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/erlang.png.svn-base +0 -0
  195. data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/eunit.html.svn-base +0 -172
  196. data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/index.html.svn-base +0 -17
  197. data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/modules-frame.html.svn-base +0 -12
  198. data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/overview-summary.html.svn-base +0 -984
  199. data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/overview.edoc.svn-base +0 -980
  200. data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/packages-frame.html.svn-base +0 -11
  201. data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/stylesheet.css.svn-base +0 -55
  202. data/lib/erlang/messenger/lib/eunit/ebin/.svn/all-wcprops +0 -5
  203. data/lib/erlang/messenger/lib/eunit/ebin/.svn/dir-prop-base +0 -8
  204. data/lib/erlang/messenger/lib/eunit/ebin/.svn/entries +0 -28
  205. data/lib/erlang/messenger/lib/eunit/ebin/.svn/format +0 -1
  206. data/lib/erlang/messenger/lib/eunit/examples/.svn/all-wcprops +0 -23
  207. data/lib/erlang/messenger/lib/eunit/examples/.svn/entries +0 -66
  208. data/lib/erlang/messenger/lib/eunit/examples/.svn/format +0 -1
  209. data/lib/erlang/messenger/lib/eunit/examples/.svn/prop-base/eunit_examples.erl.svn-base +0 -5
  210. data/lib/erlang/messenger/lib/eunit/examples/.svn/prop-base/fib.erl.svn-base +0 -5
  211. data/lib/erlang/messenger/lib/eunit/examples/.svn/text-base/eunit_examples.erl.svn-base +0 -339
  212. data/lib/erlang/messenger/lib/eunit/examples/.svn/text-base/fib.erl.svn-base +0 -19
  213. data/lib/erlang/messenger/lib/eunit/examples/.svn/text-base/tests.txt.svn-base +0 -1
  214. data/lib/erlang/messenger/lib/eunit/include/.svn/all-wcprops +0 -11
  215. data/lib/erlang/messenger/lib/eunit/include/.svn/entries +0 -41
  216. data/lib/erlang/messenger/lib/eunit/include/.svn/format +0 -1
  217. data/lib/erlang/messenger/lib/eunit/include/.svn/prop-base/eunit.hrl.svn-base +0 -5
  218. data/lib/erlang/messenger/lib/eunit/include/.svn/text-base/eunit.hrl.svn-base +0 -313
  219. data/lib/erlang/messenger/lib/eunit/src/.svn/all-wcprops +0 -113
  220. data/lib/erlang/messenger/lib/eunit/src/.svn/entries +0 -259
  221. data/lib/erlang/messenger/lib/eunit/src/.svn/format +0 -1
  222. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/autoload.erl.svn-base +0 -5
  223. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/code_monitor.erl.svn-base +0 -5
  224. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit.erl.svn-base +0 -5
  225. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_autoexport.erl.svn-base +0 -5
  226. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_data.erl.svn-base +0 -5
  227. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_internal.hrl.svn-base +0 -5
  228. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_lib.erl.svn-base +0 -5
  229. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_proc.erl.svn-base +0 -5
  230. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_serial.erl.svn-base +0 -5
  231. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_server.erl.svn-base +0 -5
  232. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_striptests.erl.svn-base +0 -5
  233. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_test.erl.svn-base +0 -5
  234. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_tests.erl.svn-base +0 -5
  235. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_tty.erl.svn-base +0 -5
  236. data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/file_monitor.erl.svn-base +0 -5
  237. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/autoload.erl.svn-base +0 -388
  238. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/code_monitor.erl.svn-base +0 -243
  239. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit.app.src.svn-base +0 -21
  240. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit.appup.src.svn-base +0 -1
  241. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit.erl.svn-base +0 -196
  242. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_autoexport.erl.svn-base +0 -102
  243. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_data.erl.svn-base +0 -798
  244. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_internal.hrl.svn-base +0 -48
  245. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_lib.erl.svn-base +0 -682
  246. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_proc.erl.svn-base +0 -552
  247. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_serial.erl.svn-base +0 -157
  248. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_server.erl.svn-base +0 -340
  249. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_striptests.erl.svn-base +0 -64
  250. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_test.erl.svn-base +0 -334
  251. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_tests.erl.svn-base +0 -45
  252. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_tty.erl.svn-base +0 -272
  253. data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/file_monitor.erl.svn-base +0 -409
  254. data/lib/erlang/messenger/src/pm_client_old.erl +0 -52
  255. data/lib/poolparty/helpers/provisioner_base.rb +0 -346
  256. data/lib/poolparty/helpers/provisioners/master.rb +0 -205
  257. data/lib/poolparty/helpers/provisioners/slave.rb +0 -64
  258. data/spec/poolparty/helpers/provisioner_base_spec.rb +0 -134
  259. data/spec/poolparty/helpers/provisioners/master_spec.rb +0 -54
  260. data/spec/poolparty/helpers/provisioners/slave_spec.rb +0 -28
  261. /data/lib/poolparty/{pool → poolparty}/custom_resource.rb +0 -0
  262. /data/lib/poolparty/{pool → poolparty}/loggable.rb +0 -0
  263. /data/lib/poolparty/{pool → poolparty}/plugin.rb +0 -0
  264. /data/lib/poolparty/{pool → poolparty}/resources/conditional.rb +0 -0
  265. /data/lib/poolparty/{pool → poolparty}/resources/cron.rb +0 -0
  266. /data/lib/poolparty/{pool → poolparty}/resources/custom_service.rb +0 -0
  267. /data/lib/poolparty/{pool → poolparty}/resources/gem_package.rb +0 -0
  268. /data/lib/poolparty/{pool → poolparty}/resources/host.rb +0 -0
  269. /data/lib/poolparty/{pool → poolparty}/resources/mount.rb +0 -0
  270. /data/lib/poolparty/{pool → poolparty}/resources/service.rb +0 -0
  271. /data/lib/poolparty/{pool → poolparty}/resources/symlink.rb +0 -0
  272. /data/lib/poolparty/{pool → poolparty}/resources/variable.rb +0 -0
  273. /data/log/{pool.logs → pool.log} +0 -0
  274. /data/spec/poolparty/{pool/test_plugins/virtual_host_template.erb → net/log/pool.log} +0 -0
  275. /data/spec/poolparty/{pool → poolparty}/base_spec.rb +0 -0
  276. /data/spec/poolparty/{pool → poolparty}/configurers/files/ruby_basic.rb +0 -0
  277. /data/spec/poolparty/{pool → poolparty}/configurers/files/ruby_plugins.rb +0 -0
  278. /data/spec/poolparty/{pool → poolparty}/configurers/ruby_spec.rb +0 -0
  279. /data/spec/poolparty/{pool → poolparty}/custom_resource_spec.rb +0 -0
  280. /data/spec/poolparty/{pool → poolparty}/example_spec.rb +0 -0
  281. /data/spec/poolparty/{pool → poolparty}/plugin_model_spec.rb +0 -0
  282. /data/spec/poolparty/{pool → poolparty}/resources/class_package_spec.rb +0 -0
  283. /data/spec/poolparty/{pool → poolparty}/resources/conditional_spec.rb +0 -0
  284. /data/spec/poolparty/{pool → poolparty}/resources/cron_spec.rb +0 -0
  285. /data/spec/poolparty/{pool → poolparty}/resources/directory_spec.rb +0 -0
  286. /data/spec/poolparty/{pool → poolparty}/resources/exec_spec.rb +0 -0
  287. /data/spec/poolparty/{pool → poolparty}/resources/file_spec.rb +0 -0
  288. /data/spec/poolparty/{pool → poolparty}/resources/gem_spec.rb +0 -0
  289. /data/spec/poolparty/{pool → poolparty}/resources/host_spec.rb +0 -0
  290. /data/spec/poolparty/{pool → poolparty}/resources/package_spec.rb +0 -0
  291. /data/spec/poolparty/{pool → poolparty}/resources/remote_file_spec.rb +0 -0
  292. /data/spec/poolparty/{pool → poolparty}/resources/service_spec.rb +0 -0
  293. /data/spec/poolparty/{pool → poolparty}/resources/sshkey_spec.rb +0 -0
  294. /data/spec/poolparty/{pool → poolparty}/resources/symlink_spec.rb +0 -0
  295. /data/spec/poolparty/{pool → poolparty}/resources/variable_spec.rb +0 -0
  296. /data/spec/poolparty/{pool → poolparty}/script_spec.rb +0 -0
  297. /data/spec/poolparty/{pool → poolparty}/test_plugins/sshkey_test +0 -0
  298. /data/spec/poolparty/{pool → poolparty}/test_plugins/webserver.rb +0 -0
@@ -22,7 +22,7 @@ class String
22
22
  self.strip.split(/\n/).join(" && ")
23
23
  end
24
24
  def top_level_class
25
- self.split("::")[-1].underscore.downcase rescue self
25
+ self.split("::")[-1].underscore.downcase rescue self.class.to_s
26
26
  end
27
27
  def sanitize
28
28
  self.gsub(/[ \.\/\-]*/, '')
@@ -1,4 +1,12 @@
1
1
  module PoolParty
2
+ module Resources
3
+ class Resource
4
+ def self.resource_string_name(n, key)
5
+ "#{n.to_s.sanitize.capitalize}['#{key}']"
6
+ end
7
+ end
8
+ end
9
+
2
10
  module DependencyResolutions
3
11
  module Puppet
4
12
 
@@ -39,6 +47,7 @@ module PoolParty
39
47
 
40
48
  def resources_string_from_resources(res, pre="\t")
41
49
  @variables = res.extract! {|name,resource| name == :variable}
50
+
42
51
  returning Array.new do |str|
43
52
  unless @variables.empty?
44
53
  str << "\n# Variables"
@@ -54,9 +63,8 @@ module PoolParty
54
63
  end
55
64
 
56
65
  def to_s
57
- "#{class_type_name.capitalize}['#{key}']"
66
+ self.class.resource_string_name(class_type_name.capitalize, key)
58
67
  end
59
-
60
68
  end
61
69
  end
62
70
  end
@@ -0,0 +1,5 @@
1
+ class ProvisionerException < Exception
2
+ def initialize(msg="Provisioner process failed")
3
+ @message = "Error: #{msg}"
4
+ end
5
+ end
@@ -0,0 +1,31 @@
1
+ module PoolParty
2
+ module Extra
3
+ class Deployments
4
+
5
+ class << self
6
+
7
+ def include_deployment(filename)
8
+ return nil unless ::File.file? filename
9
+ name = ::File.basename(filename, ::File.extname(filename))
10
+ contents = open(filename).read
11
+
12
+ plugin_klass = PoolParty::PluginModel::PluginModel.new(name)
13
+ plugin_klass.klass.class_eval <<-EOE
14
+ def enable
15
+ #{contents}
16
+ end
17
+ EOE
18
+ plugin_klass
19
+ end
20
+
21
+ def include_deployments(dir)
22
+ return nil unless ::File.directory? dir
23
+ Dir["#{dir}/*"].each do |fi|
24
+ include_deployment fi
25
+ end
26
+ dir
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -5,7 +5,7 @@ module PoolParty
5
5
  def load_pool(filename)
6
6
 
7
7
  unless filename && ::File.readable?(filename)
8
- puts "Please specify your cloud with -s, move it to ./pool.spec or in your POOL_SPEC environment variable"
8
+ puts "Please specify your cloud with -s, move it to ./clouds.pool or in your POOL_SPEC environment variable"
9
9
  exit(1)
10
10
  else
11
11
  $pool_specfile = filename
@@ -13,6 +13,15 @@ module PoolParty
13
13
  end
14
14
  end
15
15
 
16
+ def print_with_nice_printer(header=nil, strs=[])
17
+ returning NicePrinter.new do |printer|
18
+ printer.header
19
+ printer.center(header) if header
20
+ strs.each {|st| printer << st if st}
21
+ printer.footer
22
+ end.print
23
+ end
24
+
16
25
  def pool_specfile
17
26
  $pool_specfile
18
27
  end
@@ -38,6 +47,7 @@ module PoolParty
38
47
  "#{Base.default_specfile_name}",
39
48
  ENV["POOL_SPEC"],
40
49
  "#{Base.storage_directory}/#{Base.default_specfile_name}",
50
+ "#{Base.base_config_directory}/#{Base.default_specfile_name}",
41
51
  "#{Base.default_project_specfile_name}"
42
52
  ].reject {|a| a.nil?}.reject do |f|
43
53
  f unless ::File.readable?(f)
@@ -47,7 +57,7 @@ module PoolParty
47
57
  def daemonize(&block)
48
58
  vputs "Daemonizing..."
49
59
  trap("CHLD") {Process.wait(-1, Process::WNOHANG)}
50
- fork do
60
+ pid = fork do
51
61
  Signal.trap('HUP', 'IGNORE') # Don't die upon logout
52
62
  File.open("/dev/null", "r+") do |devnull|
53
63
  $stdout.reopen(devnull)
@@ -56,6 +66,8 @@ module PoolParty
56
66
  end
57
67
  block.call if block
58
68
  end
69
+ Process.detach(pid)
70
+ pid
59
71
  end
60
72
 
61
73
  end
@@ -9,21 +9,58 @@ module PoolParty
9
9
  class Optioner
10
10
  include Configurable
11
11
  include MethodMissingSugar
12
-
13
- def initialize(args=[], opts={}, &block)
12
+
13
+ def initialize(args=[], opts={}, &block)
14
+ boolean_args << opts[:boolean_args] if opts.has_key?(:boolean_args)
15
+
14
16
  @arguments = parse_args(args)
15
- @parse_options = opts[:parse_options] ? opts[:parse_options] : true
16
17
  @extra_help = opts.has_key?(:extra_help) ? opts[:extra_help] : ""
17
- @abstract = opts[:abstract] ? opts[:abstract] : false
18
- @command = opts[:command] ? opts[:command] : false
18
+ @abstract = opts.has_key?(:abstract) ? opts[:abstract] : false
19
+ @load_pools = opts.has_key?(:load_pools) ? opts[:load_pools] : !@abstract
20
+ @parse_options = opts.has_key?(:parse_options) ? opts[:parse_options] : true
21
+ @command = opts.has_key?(:command) ? opts[:command] : false
19
22
 
20
23
  parse_options(&block) if @parse_options
21
24
  set_default_options
22
25
  self
23
26
  end
27
+ def daemonizeable
28
+ @opts.on('-d', '--daemonize', 'Daemonize starting the cloud') { self.daemon true }
29
+ end
30
+ def cloudnames
31
+ @opts.on('-n cloudname', '--name name', 'Start cloud by this name') { |c| self.cloudname c }
32
+ end
33
+ def unflagged_args
34
+ @unflagged_args ||= []
35
+ end
36
+ def flagged_args
37
+ @flagged_args ||= []
38
+ end
39
+ def boolean_args
40
+ @boolean_args ||= ['-V', '-h', '-t', '-v', '--debug']
41
+ end
24
42
 
25
- def parse_args(argv, safe=[])
26
- argv
43
+ # Break ARGV into 2 arrays, one for flagged options one for unflagged
44
+ # For example the "command -v -i 1 five six -x"
45
+ # becomes ['-v', '-i', 1, '-x'] and ['five', 'six']
46
+ # Boolean options, such as -v, must be specified in the optioner definition
47
+ def parse_args(args=[])
48
+ i=0
49
+ while i < args.length
50
+ if boolean_args.include?(args[i])
51
+ flagged_args << args[i]
52
+ else
53
+ if args[i][0].chr == "-"
54
+ flagged_args << args[i]
55
+ flagged_args << args[i+1] if (args[i+1] and !args[i+1].nil?)
56
+ i+=1
57
+ else
58
+ unflagged_args << args[i]
59
+ end
60
+ end
61
+ i+=1
62
+ end
63
+ args
27
64
  end
28
65
 
29
66
  def parent
@@ -37,40 +74,42 @@ module PoolParty
37
74
 
38
75
  def parse_options(&blk)
39
76
  progname = $0.include?("-") ? "#{::File.basename($0[/(\w+)-/, 1])} #{::File.basename($0[/-(.*)/, 1])}" : ::File.basename($0)
40
- opts = OptionParser.new
41
- opts.banner = "Usage: #{progname} #{@abstract ? "[command] " : ""}[options]"
77
+ @opts = OptionParser.new
78
+ @opts.banner = "Usage: #{progname} #{@abstract ? "[command] " : ""}[options]"
42
79
 
43
- opts.separator ""
80
+ @opts.separator ""
44
81
 
45
82
  unless @abstract
46
- opts.separator "Options:"
83
+ @opts.separator "Options:"
47
84
 
48
- opts.on('-v', '--verbose', 'Be verbose') { self.verbose true }
49
- opts.on('-s [file]', '--spec-file [file]', 'Set the spec file') { |file| self.spec file.chomp }
50
- opts.on('-t', '--test', 'Testing mode') { self.testing true }
51
-
52
- blk.call(opts, self) if blk
85
+ @opts.on('-v', '--verbose', 'Be verbose') { self.verbose true }
86
+ @opts.on("--debug", "Debug setting") {self.debug true}
87
+ @opts.on('-s [file]', '--spec-file [file]', 'Set the spec file') { |file| self.spec file.chomp }
88
+ @opts.on('-t', '--test', 'Testing mode') { self.testing true }
89
+
90
+ blk.call(@opts, self) if blk
53
91
  end
54
92
 
55
- opts.on('-V', '--version', 'Display the version') { puts @version ; exit 0 }
56
- opts.on_tail("-h", "--help", "Show this message") do
57
- puts opts
93
+ @opts.on('-V', '--version', 'Display the version') { puts @version ; exit 0 }
94
+ @opts.on_tail("-h", "--help", "Show this message") do
95
+ puts @opts
58
96
  puts @extra_help
59
97
  exit
60
98
  end
61
99
 
62
- opts.parse(@arguments.dup)
100
+ @opts.parse(@arguments.dup)
63
101
 
64
102
  process_options
65
103
  output_options if verbose
66
- unless @abstract
104
+
105
+ if @load_pools
67
106
  self.loaded_pool load_pool(self.spec || Binary.get_existing_spec_location)
68
107
 
69
108
  self.loaded_clouds extract_cloud_from_options(self)
70
109
  self.loaded_pools extract_pool_from_options(self)
71
110
 
72
111
  reject_junk_options!
73
- raise CloudNotFoundException.new("Please specify your cloud with -s, move it to ./pool.spec or in your POOL_SPEC environment variable") unless loaded_clouds && !loaded_clouds.empty?
112
+ raise CloudNotFoundException.new("Please specify your cloud with -s, move it to ./clouds.pool or in your POOL_SPEC environment variable") unless loaded_clouds && !loaded_clouds.empty?
74
113
  loaded_pools.each do |pl|
75
114
  pl.configure(self.options)
76
115
  end
@@ -0,0 +1,33 @@
1
+ require "socket"
2
+ module PoolParty
3
+ module Ruberl
4
+ class Base
5
+ attr_accessor :host, :port
6
+ def initialize(host="localhost", port=7050)
7
+ @host = host
8
+ @port = port
9
+ end
10
+ def with_socket(&block)
11
+ begin
12
+ socket = TCPSocket.open(@host, @port)
13
+ out = yield(socket)
14
+ socket.close
15
+ out
16
+ rescue Exception => e
17
+ end
18
+ end
19
+ def messenger_send!(msg="get_current_load cpu")
20
+ with_socket do |sock|
21
+ sock.send(msg, 0)
22
+ @str = sock.recv(2000)
23
+ end
24
+ @str
25
+ end
26
+ def messenger_cast!(msg="force_reconfig")
27
+ with_socket do |sock|
28
+ sock.send(msg, 0)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -5,8 +5,9 @@ module PoolParty
5
5
  ebs_volume_id id
6
6
  ebs_volume_mount_point loc
7
7
  ebs_volume_device "/dev/#{id.sanitize}"
8
- has_directory(:name => loc)
8
+
9
9
  has_mount(:name => loc, :device => ebs_volume_device)
10
+ has_directory(:name => loc)
10
11
  end
11
12
 
12
13
  end
@@ -4,7 +4,7 @@ module PoolParty
4
4
  module CloudResourcer
5
5
 
6
6
  def plugin_directory(*args)
7
- args = ["/plugins"] if args.empty?
7
+ args = ["#{::File.expand_path(Dir.pwd)}/plugins"] if args.empty?
8
8
  args.each {|arg| Dir["#{arg}/*/*.rb"].each {|f| require f rescue "" }}
9
9
  end
10
10
 
@@ -23,11 +23,25 @@ module PoolParty
23
23
  self.run_in_context @stored_block if @stored_block
24
24
  end
25
25
 
26
- # Set instances with a range
27
- def instances(arg)
28
- if arg.is_a?(Range)
26
+ # Set instances with a range or a number
27
+ def instances(arg)
28
+ case arg
29
+ when Range
29
30
  minimum_instances arg.first
30
31
  maximum_instances arg.last
32
+ when Fixnum
33
+ minimum_instances arg
34
+ maximum_instances arg
35
+ else
36
+ raise SpecException.new("Don't know how to handle instances cloud input #{arg}")
37
+ end
38
+ end
39
+
40
+ def setup_dev
41
+ unless ::File.exists?("#{full_keypair_basename_path}.pub")
42
+ cmd = "scp #{ssh_array.join(" ")} #{Base.user}@#{master.ip}:.ssh/authorized_keys #{full_keypair_basename_path}.pub"
43
+ vputs "Running #{cmd}"
44
+ Kernel.system(cmd)
31
45
  end
32
46
  end
33
47
 
@@ -38,6 +52,14 @@ module PoolParty
38
52
  ::File.expand_path(keypair_path)
39
53
  end
40
54
  end
55
+ def full_pub_keypair_path
56
+ @full_pub_keypair_path ||= ::File.expand_path("#{full_keypair_basename_path}.pub")
57
+ end
58
+ def full_keypair_basename_path
59
+ dir = ::File.dirname(full_keypair_path)
60
+ basename = ::File.basename(full_keypair_path, ::File.extname(full_keypair_path))
61
+ ::File.join(dir, basename)
62
+ end
41
63
 
42
64
  def keypair_path
43
65
  keypair_paths.each do |path|
@@ -49,6 +71,8 @@ module PoolParty
49
71
  return nil
50
72
  end
51
73
 
74
+ # The keypair name can be one name or another including id_rsa or not
75
+ # So let's get the name that exists as a keypair
52
76
  def full_keypair_name
53
77
  keypair_paths.each do |path|
54
78
  possible_keypair_basenames.each do |base|
@@ -120,8 +144,8 @@ module PoolParty
120
144
  @plugin_store ||= []
121
145
  end
122
146
 
123
- def realize_plugins!
124
- plugin_store.each {|plugin| plugin.realize! if plugin }
147
+ def realize_plugins!(force=false)
148
+ plugin_store.each {|plugin| plugin.realize!(force) if plugin }
125
149
  end
126
150
 
127
151
  def plugin_store
@@ -1,3 +1,5 @@
1
+ #TODO: rdoc: this defines methods on poolparty objects from a passed hash of options.
2
+ # For example, this is how instance.minimum_runtime is set. See base.rb line 12 for example of default options that are added as methods in this way.
1
3
  module PoolParty
2
4
  module Configurable
3
5
  module ClassMethods
@@ -2,8 +2,8 @@ module PoolParty
2
2
  module FileWriter
3
3
  def copy_file_to_storage_directory(file, preceded="")
4
4
  make_base_directory
5
- path = ::File.join( Base.storage_directory, preceded, ::File.basename(file) )
6
- FileUtils.cp file, path unless file == path || ::File.exists?(path)
5
+ path = ::File.join( Base.storage_directory, preceded, ::File.basename(file) )
6
+ ::FileUtils.cp file, path unless file == path || ::File.file?(path)
7
7
  end
8
8
  def cleanup_storage_directory
9
9
  Dir["#{Base.storage_directory}/**/*"].each do |f|
@@ -26,11 +26,11 @@ module PoolParty
26
26
  path = ::File.join( Base.storage_directory, dirname )
27
27
  make_base_path path
28
28
  end
29
- def write_to_file_in_storage_directory(file, str, preceded="", &block)
29
+ def write_to_file_in_storage_directory(file, str="", preceded="", &block)
30
30
  path = ::File.join( Base.storage_directory, preceded, ::File.basename(file) )
31
31
  write_to_file(path, str, &block)
32
32
  end
33
- def write_to_file(file, str, preceded="", &block)
33
+ def write_to_file(file, str="", preceded="", &block)
34
34
  path = ::File.join( Base.storage_directory, preceded, ::File.basename(file) )
35
35
  make_base_path( Base.storage_directory )
36
36
  ::File.open(path, "w+") do |f|
@@ -10,12 +10,12 @@ module PoolParty
10
10
  str ? options.append!(:require => send_if_method(str)) : options[:require]
11
11
  end
12
12
  def ensures(str="running")
13
- if %w(absent running).map {|a| self.send a.to_sym}.include?(str)
13
+ # if %w(absent running).map {|a| self.send a.to_sym}.include?(str)
14
14
  str == "absent" ? is_absent : is_present
15
- else
16
- options.append!(:ensure => str)
17
- end
18
- str
15
+ # else
16
+ # options.append!(:ensure => str)
17
+ # end
18
+ # str
19
19
  end
20
20
  # Allows us to send an ensure to ensure the presence of a resource
21
21
  def is_present(*args)
@@ -29,7 +29,7 @@
29
29
  Notice that at the end, you must call register_monitor :monitorname. This will tell your cloud
30
30
  that it can monitor it with this monitor.
31
31
  =end
32
- require "#{::File.dirname(__FILE__)}/../pool/base"
32
+ require "#{::File.dirname(__FILE__)}/../poolparty/base"
33
33
 
34
34
  module PoolParty
35
35
  module Monitors
@@ -4,8 +4,8 @@ module PoolParty
4
4
  class CpuMonitor < BaseMonitor
5
5
 
6
6
  def run
7
- str = %x[uptime]
8
- str.split(/\s+/)[-1].to_f rescue 0.0
7
+ stdin, stdout, stderr = Open3.popen3('uptime')
8
+ stdout.split(/\s+/)[-1].to_f rescue 0.0
9
9
  end
10
10
 
11
11
  end
@@ -16,7 +16,7 @@ module PoolParty
16
16
  end
17
17
  # TODO: Fix cookie setting
18
18
  def self.erl_command(hostname, extra="", min_ports=7000, max_ports=7050)
19
- command_line_opts = "-pa #{append_dir}/ebin -kernel inet_dist_listen_min #{min_ports} inet_dist_listen_max #{max_ports} -sname #{hostname} -setcookie poolparty"
19
+ command_line_opts = "-pa #{append_dir}/ebin -kernel inet_dist_listen_min #{min_ports} inet_dist_listen_max #{max_ports} -sname #{hostname}"
20
20
 
21
21
  "erl #{command_line_opts} #{extra}"
22
22
  end
@@ -8,8 +8,8 @@ module PoolParty
8
8
 
9
9
  def using(t)
10
10
  @cloud = self
11
- if available_bases.include?(t.to_sym)
12
- unless using_remoter? || t.nil?
11
+ if t && available_bases.include?(t.to_sym)
12
+ unless using_remoter?
13
13
  self.class.send :attr_reader, :remote_base
14
14
  self.class.send :attr_reader, :parent_cloud
15
15
  mod = "#{t}".preserved_module_constant
@@ -29,7 +29,7 @@ begin
29
29
  :minCount => 1,
30
30
  :maxCount => num,
31
31
  :key_name => (keypair || Base.keypair),
32
- :availability_zone => nil,
32
+ :availability_zone => (availabilty_zone || Base.availabilty_zone),
33
33
  :instance_type => "#{size || Base.size}",
34
34
  :group_id => ["#{security_group || Base.security_group}"])
35
35
  begin
@@ -71,18 +71,24 @@ begin
71
71
  EC2ResponseObject.get_descriptions(ec2.describe_instances)
72
72
  end
73
73
 
74
- def after_launch_master(instance=nil)
74
+ def after_launch_master(inst=nil)
75
+ instance = master
76
+ vputs "Running tasks after launching the master"
75
77
  begin
76
- when_no_pending_instances do
78
+ # when_no_pending_instances do
77
79
  if instance
78
- ec2.associate_address(:instance_id => instance.instanceId, :public_ip => set_master_ip_to) if set_master_ip_to
79
- ec2.attach_volume(:volume_id => ebs_volume_id, :instance_id => instance.instanceId, :device => ebs_volume_device) if ebs_volume_id && ebs_volume_mount_point
80
+ ec2.attach_volume(:volume_id => ebs_volume_id, :instance_id => instance.instance_id, :device => ebs_volume_device) if ebs_volume_id && ebs_volume_mount_point
81
+ # Let's associate the address LAST so that we can still connect to the instance
82
+ # for the other tasks here
83
+ ec2.associate_address(:instance_id => instance.instance_id, :public_ip => set_master_ip_to) if set_master_ip_to
84
+ reset_remoter_base!
80
85
  end
81
- end
86
+ # end
82
87
  rescue Exception => e
88
+ vputs "Error in after_launch_master: #{e}"
83
89
  end
84
90
  reset_remoter_base!
85
- when_all_assigned_ips {wait "2.seconds"}
91
+ when_all_assigned_ips {wait "5.seconds"}
86
92
  end
87
93
 
88
94
  # Help create a keypair for the cloud
@@ -108,23 +114,57 @@ begin
108
114
  :secret_access_key => (secret_access_key || Base.secret_access_key)
109
115
  )
110
116
  end
117
+
118
+ def before_configuration_tasks
119
+ if has_cert_and_key?
120
+ # copy_file_to_storage_directory(pub_key)
121
+ # copy_file_to_storage_directory(private_key)
122
+ end
123
+ end
124
+ def has_cert_and_key?
125
+ pub_key && private_key
126
+ end
127
+ # The keys are used only for puppet certificates
128
+ # and are only used for EC2.
129
+ # Public key
130
+ def pub_key
131
+ @pub_key ||= ENV["EC2_CERT"] ? ENV["EC2_CERT"] : nil
132
+ end
133
+ # Private key
134
+ def private_key
135
+ @private_key ||= ENV["EC2_PRIVATE_KEY"] ? ENV["EC2_PRIVATE_KEY"] : nil
136
+ end
137
+
138
+ def custom_minimum_runnable_options
139
+ [:ami, :availabilty_zone, :security_group]
140
+ end
111
141
 
112
- # Callback
142
+ # Hook
143
+ #TODO#: Change this so they match with the cap tasks
113
144
  def custom_install_tasks_for(o)
114
- [
145
+ arr = if has_cert_and_key?
146
+ [
147
+ # "mv #{::File.basename(pub_key)} #{Base.base_config_directory}/ssl/public_keys/#{o.name}.pem",
148
+ # "mv #{::File.basename(private_key)} #{Base.base_config_directory}/ssl/private_keys/#{o.name}.pem"
149
+ ]
150
+ else
151
+ []
152
+ end
153
+ arr << [
115
154
  "# ec2 installation tasks",
116
155
  "# Set hostname",
117
156
  # "if [ -z $(grep -v '#' /etc/hosts | grep '#{o.name}') ]; then echo \"$(curl http://169.254.169.254/latest/meta-data/public-ipv4) #{o.name}\" >> /etc/hosts; fi",
118
157
  "if [ -z \"$(grep -v '#' /etc/hosts | grep '#{o.name}')\" ]; then echo '127.0.0.1 #{o.name}' >> /etc/hosts; fi",
119
158
  "hostname #{o.name}",
120
159
  "echo #{o.name} > /etc/hostname",
121
- "cd /var/poolparty && wget http://rubyforge.org/frs/download.php/43666/amazon-ec2-0.3.1.gem -O amazon-ec2.gem 2>&1 && gem install -y --no-ri --no-rdoc amazon-ec2.gem 2>&1"
160
+ "cd /var/poolparty && wget http://rubyforge.org/frs/download.php/43666/amazon-ec2-0.3.1.gem -O amazon-ec2.gem 2>&1",
161
+ "/usr/bin/gem install -y --no-ri --no-rdoc amazon-ec2.gem 2>&1",
122
162
  ]
163
+ []
123
164
  end
124
165
 
125
166
  def custom_configure_tasks_for(o)
126
167
  [
127
- "# ec2 configuration"
128
168
  ]
129
169
  end
130
170
 
@@ -8,17 +8,21 @@ module PoolParty
8
8
  include Configurable
9
9
  include CloudResourcer
10
10
 
11
- def initialize(opts, parent=nil)
11
+ def initialize(opts, parent=self)
12
12
  run_setup(parent)
13
-
13
+
14
14
  set_vars_from_options(parent.options) if parent && parent.respond_to?(:options)
15
15
  set_vars_from_options(opts) unless opts.nil? || opts.empty?
16
16
 
17
17
  on_init
18
18
  end
19
19
 
20
+ def elapsed_runtime
21
+ Time.now.to_i - launching_time.to_time.to_i
22
+ end
23
+
20
24
  # Callback
21
- def on_init
25
+ def on_init
22
26
  end
23
27
 
24
28
  # Is this remote instance the master?