fairchild-poolparty 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (333) hide show
  1. data/README.txt +0 -12
  2. data/Rakefile +17 -1
  3. data/VERSION.yml +1 -1
  4. data/bin/cloud +20 -1
  5. data/bin/cloud-bootstrap +14 -4
  6. data/bin/cloud-configure +26 -9
  7. data/bin/cloud-contract +7 -7
  8. data/bin/cloud-describe +28 -0
  9. data/bin/cloud-expand +13 -6
  10. data/bin/cloud-list +3 -5
  11. data/bin/cloud-osxcopy +1 -1
  12. data/bin/cloud-provision +1 -1
  13. data/bin/cloud-show +6 -5
  14. data/bin/cloud-ssh +1 -3
  15. data/bin/cloud-start +8 -6
  16. data/bin/cloud-terminate +9 -7
  17. data/bin/server-cloud-elections +29 -18
  18. data/bin/server-ensure-provisioning +24 -29
  19. data/bin/server-list-active +10 -5
  20. data/bin/server-monitor.ru +18 -1
  21. data/bin/server-update-hosts +3 -3
  22. data/bin/server-write-new-nodes +1 -1
  23. data/config/jeweler.rb +12 -3
  24. data/lib/poolparty/aska/aska.rb +1 -12
  25. data/lib/poolparty/base_packages/haproxy.rb +26 -18
  26. data/lib/poolparty/base_packages/poolparty.rb +1 -1
  27. data/lib/poolparty/capistrano.rb +1 -1
  28. data/lib/poolparty/core/array.rb +12 -0
  29. data/lib/poolparty/core/hash.rb +12 -5
  30. data/lib/poolparty/core/nil.rb +8 -0
  31. data/lib/poolparty/core/object.rb +15 -5
  32. data/lib/poolparty/core/string.rb +28 -2
  33. data/lib/poolparty/dependency_resolver/chef_resolver.rb +106 -79
  34. data/lib/poolparty/dependency_resolver/dependency_resolver.rb +1 -1
  35. data/lib/poolparty/dependency_resolver/dependency_resolver_cloud_extensions.rb +5 -4
  36. data/lib/poolparty/dependency_resolver/puppet_resolver.rb +44 -17
  37. data/lib/poolparty/helpers/console.rb +1 -1
  38. data/lib/poolparty/helpers/optioner.rb +9 -2
  39. data/lib/poolparty/lite.rb +12 -2
  40. data/lib/poolparty/modules/callbacks.rb +44 -0
  41. data/lib/poolparty/modules/cloud_dsl.rb +17 -11
  42. data/lib/poolparty/modules/cloud_resourcer.rb +29 -21
  43. data/lib/poolparty/modules/definable_resource.rb +1 -1
  44. data/lib/poolparty/modules/pinger.rb +28 -0
  45. data/lib/poolparty/modules/resourcing_dsl.rb +7 -3
  46. data/lib/poolparty/modules/thread_pool.rb +107 -106
  47. data/lib/poolparty/modules/user_helpers.rb +20 -0
  48. data/lib/poolparty/monitors/base_monitor.rb +32 -81
  49. data/lib/poolparty/monitors/monitor_rack.rb +60 -69
  50. data/lib/poolparty/monitors/monitors/favicon_monitor.rb +12 -0
  51. data/lib/poolparty/monitors/monitors/load_monitor.rb +9 -15
  52. data/lib/poolparty/monitors/monitors/memory_monitor.rb +48 -48
  53. data/lib/poolparty/monitors/monitors/neighborhood_monitor.rb +77 -0
  54. data/lib/poolparty/monitors/{stats_monitor.rb → monitors/stats_monitor.rb} +29 -24
  55. data/lib/poolparty/monitors/monitors/time_monitor.rb +15 -0
  56. data/lib/poolparty/net/messenger.rb +2 -0
  57. data/lib/poolparty/net/remoter/cloud_control.rb +177 -227
  58. data/lib/poolparty/net/remoter/connections.rb +10 -18
  59. data/lib/poolparty/net/remoter/interactive.rb +24 -90
  60. data/lib/poolparty/net/remoter_base.rb +98 -25
  61. data/lib/poolparty/net/remoter_bases/ec2/ec2.rb +83 -66
  62. data/lib/poolparty/net/remoter_bases/vmrun/utilities/vm_disk.rb +12 -0
  63. data/lib/poolparty/net/remoter_bases/vmrun/utilities/vmx.rb +33 -0
  64. data/lib/poolparty/net/remoter_bases/vmrun/utilities/vmx_file.rb +117 -0
  65. data/lib/poolparty/net/remoter_bases/vmrun/vmrun.rb +165 -0
  66. data/lib/poolparty/net/remoter_bases/vmrun/vmrun_instance.rb +71 -0
  67. data/lib/poolparty/{base_packages → plugins}/bind.rb +1 -1
  68. data/lib/poolparty/plugins/chef.rb +71 -71
  69. data/lib/poolparty/plugins/chef_deploy.rb +58 -0
  70. data/lib/poolparty/plugins/{deploydirectory.rb → deploy_directory.rb} +12 -3
  71. data/lib/poolparty/plugins/dynomite.rb +14 -0
  72. data/lib/poolparty/plugins/gem_package.rb +37 -0
  73. data/lib/poolparty/plugins/line_in_file.rb +1 -0
  74. data/lib/poolparty/plugins/nanite.rb +41 -0
  75. data/lib/poolparty/{base_packages → plugins}/tokyo_tyrant.rb +1 -1
  76. data/lib/poolparty/poolparty/cloud.rb +36 -35
  77. data/lib/poolparty/poolparty/default.rb +2 -11
  78. data/lib/poolparty/poolparty/key.rb +15 -12
  79. data/lib/poolparty/poolparty/neighborhoods.rb +54 -21
  80. data/lib/poolparty/poolparty/plugin.rb +6 -9
  81. data/lib/poolparty/poolparty/plugin_model.rb +5 -5
  82. data/lib/poolparty/poolparty/pool.rb +8 -4
  83. data/lib/poolparty/poolparty/poolparty_base_class.rb +20 -11
  84. data/lib/poolparty/poolparty/resource.rb +9 -5
  85. data/lib/poolparty/poolparty/service.rb +3 -1
  86. data/lib/poolparty/provision/boot_strapper.rb +47 -24
  87. data/lib/poolparty/provision/configurations/chef.rb +7 -4
  88. data/lib/poolparty/provision/dr_configure.rb +80 -25
  89. data/lib/poolparty/resources/cron.rb +8 -0
  90. data/lib/poolparty/resources/directory.rb +1 -1
  91. data/lib/poolparty/resources/file.rb +16 -0
  92. data/lib/poolparty/resources/package.rb +7 -2
  93. data/lib/poolparty/resources/service.rb +4 -3
  94. data/lib/poolparty/resources/symlink.rb +0 -8
  95. data/lib/poolparty/schema.rb +35 -20
  96. data/lib/poolparty/templates/haproxy.conf +27 -25
  97. data/lib/poolparty/templates/monitor.ru +3 -3
  98. data/lib/poolparty/verification/verifier_base.rb +17 -0
  99. data/lib/poolparty/verification/verifiers/ping.rb +17 -0
  100. data/lib/poolparty/verification/verify.rb +74 -0
  101. data/lib/poolparty.rb +8 -9
  102. data/lib/poolpartycl.rb +14 -0
  103. data/spec/bin/server-list-active_spec.rb +2 -0
  104. data/spec/poolparty/base_packages/haproxy_spec.rb +1 -1
  105. data/spec/poolparty/core/array_spec.rb +3 -1
  106. data/spec/poolparty/core/ordered_hash_spec.rb +2 -2
  107. data/spec/poolparty/dependency_resolver/chef_resolver_spec.rb +9 -15
  108. data/spec/poolparty/dependency_resolver/dependency_resolver_cloud_extensions_spec.rb +6 -6
  109. data/spec/poolparty/dependency_resolver/puppet_resolver_spec.rb +121 -124
  110. data/spec/poolparty/net/remote_spec.rb +287 -286
  111. data/spec/poolparty/net/remoter_bases/ec2_mocks_and_stubs.rb +1 -1
  112. data/spec/poolparty/net/remoter_bases/ec2_remote_instance_spec.rb +7 -8
  113. data/spec/poolparty/net/remoter_bases/ec2_spec.rb +22 -7
  114. data/spec/poolparty/net/remoter_spec.rb +48 -45
  115. data/spec/poolparty/poolparty/cloud_spec.rb +15 -22
  116. data/spec/poolparty/poolparty/key_spec.rb +4 -4
  117. data/spec/poolparty/poolparty/neighborhoods_spec.rb +1 -2
  118. data/spec/poolparty/poolparty/plugin_spec.rb +2 -2
  119. data/spec/poolparty/poolparty/resource_spec.rb +4 -5
  120. data/spec/poolparty/poolparty_base_class_spec.rb +82 -78
  121. data/spec/poolparty/resources/package_spec.rb +0 -3
  122. data/spec/poolparty/spec_helper.rb +4 -4
  123. data/tasks/development.rake +9 -0
  124. data/test/poolparty/core/array_test.rb +21 -0
  125. data/test/poolparty/core/hash_test.rb +14 -1
  126. data/test/poolparty/core/string_test.rb +29 -0
  127. data/test/poolparty/dependency_resolver/puppet_resolver_test.rb +106 -0
  128. data/test/poolparty/modules/callbacks_test.rb +40 -0
  129. data/test/poolparty/modules/cloud_dsl_test.rb +25 -0
  130. data/test/poolparty/net/remoter_bases/vmrun/vmrun_test.rb +50 -0
  131. data/test/poolparty/net/remoter_test.rb +14 -0
  132. data/test/poolparty/poolparty/neighborhood_test.rb +23 -0
  133. data/test/poolparty/poolparty/poolparty_base_class_test.rb +84 -0
  134. data/test/poolparty/verification/verify_test.rb +49 -0
  135. data/test/test_helper.rb +4 -1
  136. data/test/test_poolparty.rb +6 -5
  137. data/vendor/chef/apache2/attributes/apache.rb +1 -1
  138. data/vendor/chef/apache2/templates/default/default-site.erb +1 -1
  139. data/vendor/chef/chef-deploy/LICENSE +201 -0
  140. data/vendor/chef/chef-deploy/README.rdoc +24 -0
  141. data/vendor/chef/chef-deploy/Rakefile +57 -0
  142. data/vendor/chef/chef-deploy/TODO +4 -0
  143. data/vendor/chef/chef-deploy/lib/chef-deploy/cached_deploy.rb +230 -0
  144. data/vendor/chef/chef-deploy/lib/chef-deploy/git.rb +132 -0
  145. data/vendor/chef/chef-deploy/lib/chef-deploy/subversion.rb +98 -0
  146. data/vendor/chef/chef-deploy/lib/chef-deploy.rb +183 -0
  147. metadata +57 -252
  148. data/bin/cloud-run +0 -18
  149. data/bin/cloud-stats +0 -17
  150. data/bin/ec2-list-active +0 -24
  151. data/bin/pool +0 -31
  152. data/bin/pool-describe +0 -8
  153. data/bin/pool-generate +0 -18
  154. data/bin/pool-init +0 -28
  155. data/bin/pool-list +0 -30
  156. data/bin/pool-start +0 -26
  157. data/bin/server-list-instances +0 -15
  158. data/lib/erlang/messenger/Emakefile +0 -1
  159. data/lib/erlang/messenger/Makefile +0 -15
  160. data/lib/erlang/messenger/README +0 -5
  161. data/lib/erlang/messenger/Rakefile +0 -72
  162. data/lib/erlang/messenger/control +0 -11
  163. data/lib/erlang/messenger/ebin/client.app +0 -19
  164. data/lib/erlang/messenger/ebin/master.app +0 -19
  165. data/lib/erlang/messenger/ebin/node.app +0 -19
  166. data/lib/erlang/messenger/ebin/packager.app +0 -19
  167. data/lib/erlang/messenger/ebin/pm_client_rel-0.1.rel +0 -1
  168. data/lib/erlang/messenger/ebin/pm_master_rel-0.1.rel +0 -1
  169. data/lib/erlang/messenger/ebin/pm_node_rel-0.1.rel +0 -1
  170. data/lib/erlang/messenger/include/defines.hrl +0 -27
  171. data/lib/erlang/messenger/lib/eunit/AUTHORS +0 -2
  172. data/lib/erlang/messenger/lib/eunit/CHANGELOG +0 -14
  173. data/lib/erlang/messenger/lib/eunit/COPYING +0 -504
  174. data/lib/erlang/messenger/lib/eunit/Makefile +0 -28
  175. data/lib/erlang/messenger/lib/eunit/NOTES +0 -276
  176. data/lib/erlang/messenger/lib/eunit/README +0 -3
  177. data/lib/erlang/messenger/lib/eunit/doc/edoc-info +0 -3
  178. data/lib/erlang/messenger/lib/eunit/doc/erlang.png +0 -0
  179. data/lib/erlang/messenger/lib/eunit/doc/eunit.html +0 -172
  180. data/lib/erlang/messenger/lib/eunit/doc/index.html +0 -17
  181. data/lib/erlang/messenger/lib/eunit/doc/modules-frame.html +0 -12
  182. data/lib/erlang/messenger/lib/eunit/doc/overview-summary.html +0 -984
  183. data/lib/erlang/messenger/lib/eunit/doc/overview.edoc +0 -980
  184. data/lib/erlang/messenger/lib/eunit/doc/packages-frame.html +0 -11
  185. data/lib/erlang/messenger/lib/eunit/doc/stylesheet.css +0 -55
  186. data/lib/erlang/messenger/lib/eunit/ebin/autoload.beam +0 -0
  187. data/lib/erlang/messenger/lib/eunit/ebin/code_monitor.beam +0 -0
  188. data/lib/erlang/messenger/lib/eunit/ebin/eunit.app +0 -21
  189. data/lib/erlang/messenger/lib/eunit/ebin/eunit.appup +0 -1
  190. data/lib/erlang/messenger/lib/eunit/ebin/eunit.beam +0 -0
  191. data/lib/erlang/messenger/lib/eunit/ebin/eunit_autoexport.beam +0 -0
  192. data/lib/erlang/messenger/lib/eunit/ebin/eunit_data.beam +0 -0
  193. data/lib/erlang/messenger/lib/eunit/ebin/eunit_lib.beam +0 -0
  194. data/lib/erlang/messenger/lib/eunit/ebin/eunit_proc.beam +0 -0
  195. data/lib/erlang/messenger/lib/eunit/ebin/eunit_serial.beam +0 -0
  196. data/lib/erlang/messenger/lib/eunit/ebin/eunit_server.beam +0 -0
  197. data/lib/erlang/messenger/lib/eunit/ebin/eunit_striptests.beam +0 -0
  198. data/lib/erlang/messenger/lib/eunit/ebin/eunit_test.beam +0 -0
  199. data/lib/erlang/messenger/lib/eunit/ebin/eunit_tests.beam +0 -0
  200. data/lib/erlang/messenger/lib/eunit/ebin/eunit_tty.beam +0 -0
  201. data/lib/erlang/messenger/lib/eunit/ebin/file_monitor.beam +0 -0
  202. data/lib/erlang/messenger/lib/eunit/examples/eunit_examples.erl +0 -339
  203. data/lib/erlang/messenger/lib/eunit/examples/fib.erl +0 -19
  204. data/lib/erlang/messenger/lib/eunit/examples/tests.txt +0 -1
  205. data/lib/erlang/messenger/lib/eunit/include/eunit.hrl +0 -313
  206. data/lib/erlang/messenger/lib/eunit/src/Makefile +0 -46
  207. data/lib/erlang/messenger/lib/eunit/src/autoload.erl +0 -388
  208. data/lib/erlang/messenger/lib/eunit/src/code_monitor.erl +0 -243
  209. data/lib/erlang/messenger/lib/eunit/src/eunit.app.src +0 -21
  210. data/lib/erlang/messenger/lib/eunit/src/eunit.appup.src +0 -1
  211. data/lib/erlang/messenger/lib/eunit/src/eunit.erl +0 -196
  212. data/lib/erlang/messenger/lib/eunit/src/eunit_autoexport.erl +0 -102
  213. data/lib/erlang/messenger/lib/eunit/src/eunit_data.erl +0 -798
  214. data/lib/erlang/messenger/lib/eunit/src/eunit_internal.hrl +0 -48
  215. data/lib/erlang/messenger/lib/eunit/src/eunit_lib.erl +0 -682
  216. data/lib/erlang/messenger/lib/eunit/src/eunit_proc.erl +0 -552
  217. data/lib/erlang/messenger/lib/eunit/src/eunit_serial.erl +0 -157
  218. data/lib/erlang/messenger/lib/eunit/src/eunit_server.erl +0 -340
  219. data/lib/erlang/messenger/lib/eunit/src/eunit_striptests.erl +0 -64
  220. data/lib/erlang/messenger/lib/eunit/src/eunit_test.erl +0 -334
  221. data/lib/erlang/messenger/lib/eunit/src/eunit_tests.erl +0 -45
  222. data/lib/erlang/messenger/lib/eunit/src/eunit_tty.erl +0 -272
  223. data/lib/erlang/messenger/lib/eunit/src/file_monitor.erl +0 -409
  224. data/lib/erlang/messenger/lib/eunit/sys.config +0 -9
  225. data/lib/erlang/messenger/lib/eunit/vsn.mk +0 -1
  226. data/lib/erlang/messenger/pm_client_rel-0.1.boot +0 -0
  227. data/lib/erlang/messenger/pm_client_rel-0.1.script +0 -238
  228. data/lib/erlang/messenger/pm_master_rel-0.1.boot +0 -0
  229. data/lib/erlang/messenger/pm_master_rel-0.1.script +0 -239
  230. data/lib/erlang/messenger/pm_node_rel-0.1.boot +0 -0
  231. data/lib/erlang/messenger/pm_node_rel-0.1.script +0 -237
  232. data/lib/erlang/messenger/src/client_app.erl +0 -39
  233. data/lib/erlang/messenger/src/client_server.erl +0 -60
  234. data/lib/erlang/messenger/src/master_app.erl +0 -39
  235. data/lib/erlang/messenger/src/node_app.erl +0 -39
  236. data/lib/erlang/messenger/src/pm_client.erl +0 -49
  237. data/lib/erlang/messenger/src/pm_client_supervisor.erl +0 -38
  238. data/lib/erlang/messenger/src/pm_cluster.erl +0 -61
  239. data/lib/erlang/messenger/src/pm_event_manager.erl +0 -27
  240. data/lib/erlang/messenger/src/pm_master.erl +0 -215
  241. data/lib/erlang/messenger/src/pm_master_event_handler.erl +0 -72
  242. data/lib/erlang/messenger/src/pm_master_supervisor.erl +0 -39
  243. data/lib/erlang/messenger/src/pm_node.erl +0 -200
  244. data/lib/erlang/messenger/src/pm_node_supervisor.erl +0 -38
  245. data/lib/erlang/messenger/src/pm_packager.erl +0 -76
  246. data/lib/erlang/messenger/src/pm_spawner.erl +0 -213
  247. data/lib/erlang/messenger/src/pm_strings.erl +0 -11
  248. data/lib/erlang/messenger/src/utils.erl +0 -72
  249. data/lib/erlang/messenger/useful_snippets +0 -17
  250. data/lib/poolparty/monitors/monitors/server_monitor.rb +0 -7
  251. data/lib/poolparty/monitors/monitors/web_monitor.rb +0 -18
  252. data/lib/poolparty/monitors/neighborhood_monitor.rb +0 -24
  253. data/lib/poolparty/monitors.rb +0 -6
  254. data/lib/poolparty/net/remoter/lists.rb +0 -12
  255. data/lib/poolparty/poolparty/custom_resource.rb +0 -45
  256. data/lib/poolparty/resources/custom_service.rb +0 -30
  257. data/lib/poolparty/services/gem_package.rb +0 -52
  258. data/lib/poolparty/version.rb +0 -15
  259. data/spec/poolparty/plugins/svn_spec.rb +0 -16
  260. data/spec/poolparty/poolparty/custom_resource_spec.rb +0 -79
  261. data/vendor/gems/butterfly/History.txt +0 -4
  262. data/vendor/gems/butterfly/PostInstall.txt +0 -2
  263. data/vendor/gems/butterfly/README.rdoc +0 -48
  264. data/vendor/gems/butterfly/Rakefile +0 -62
  265. data/vendor/gems/butterfly/VERSION.yml +0 -4
  266. data/vendor/gems/butterfly/bin/flutter +0 -4
  267. data/vendor/gems/butterfly/butterfly.gemspec +0 -37
  268. data/vendor/gems/butterfly/examples/config.ru +0 -15
  269. data/vendor/gems/butterfly/examples/my_app.rb +0 -12
  270. data/vendor/gems/butterfly/lib/butterfly.rb +0 -14
  271. data/vendor/gems/butterfly/lib/handler.rb +0 -48
  272. data/vendor/gems/butterfly/lib/request.rb +0 -29
  273. data/vendor/gems/butterfly/lib/response.rb +0 -49
  274. data/vendor/gems/butterfly/script/console +0 -10
  275. data/vendor/gems/butterfly/script/destroy +0 -14
  276. data/vendor/gems/butterfly/script/generate +0 -14
  277. data/vendor/gems/butterfly/test/test_adapter_base.rb +0 -23
  278. data/vendor/gems/butterfly/test/test_butterfly_request.rb +0 -46
  279. data/vendor/gems/butterfly/test/test_butterfly_response.rb +0 -43
  280. data/vendor/gems/butterfly/test/test_butterfly_server.rb +0 -16
  281. data/vendor/gems/butterfly/test/test_default.rb +0 -12
  282. data/vendor/gems/butterfly/test/test_helper.rb +0 -6
  283. data/vendor/gems/dslify/History.txt +0 -4
  284. data/vendor/gems/dslify/Manifest.txt +0 -25
  285. data/vendor/gems/dslify/PostInstall.txt +0 -5
  286. data/vendor/gems/dslify/README.txt +0 -60
  287. data/vendor/gems/dslify/Rakefile +0 -56
  288. data/vendor/gems/dslify/config/hoe.rb +0 -73
  289. data/vendor/gems/dslify/config/requirements.rb +0 -15
  290. data/vendor/gems/dslify/dslify.gemspec +0 -40
  291. data/vendor/gems/dslify/lib/dslify/dslify.rb +0 -69
  292. data/vendor/gems/dslify/lib/dslify/version.rb +0 -10
  293. data/vendor/gems/dslify/lib/dslify.rb +0 -7
  294. data/vendor/gems/dslify/script/console +0 -10
  295. data/vendor/gems/dslify/script/destroy +0 -14
  296. data/vendor/gems/dslify/script/generate +0 -14
  297. data/vendor/gems/dslify/script/txt2html +0 -82
  298. data/vendor/gems/dslify/setup.rb +0 -1585
  299. data/vendor/gems/dslify/tasks/deployment.rake +0 -34
  300. data/vendor/gems/dslify/tasks/environment.rake +0 -7
  301. data/vendor/gems/dslify/tasks/website.rake +0 -17
  302. data/vendor/gems/dslify/test/test_dslify.rb +0 -114
  303. data/vendor/gems/dslify/website/index.html +0 -86
  304. data/vendor/gems/dslify/website/index.txt +0 -83
  305. data/vendor/gems/dslify/website/javascripts/rounded_corners_lite.inc.js +0 -285
  306. data/vendor/gems/dslify/website/stylesheets/screen.css +0 -138
  307. data/vendor/gems/dslify/website/template.html.erb +0 -48
  308. data/vendor/gems/parenting/History.txt +0 -4
  309. data/vendor/gems/parenting/Manifest.txt +0 -13
  310. data/vendor/gems/parenting/PostInstall.txt +0 -2
  311. data/vendor/gems/parenting/README.rdoc +0 -47
  312. data/vendor/gems/parenting/Rakefile +0 -28
  313. data/vendor/gems/parenting/lib/parenting/base.rb +0 -65
  314. data/vendor/gems/parenting/lib/parenting.rb +0 -10
  315. data/vendor/gems/parenting/parenting.gemspec +0 -39
  316. data/vendor/gems/parenting/script/console +0 -10
  317. data/vendor/gems/parenting/script/destroy +0 -14
  318. data/vendor/gems/parenting/script/generate +0 -14
  319. data/vendor/gems/parenting/test/file_to_eval.rb +0 -9
  320. data/vendor/gems/parenting/test/test_helper.rb +0 -5
  321. data/vendor/gems/parenting/test/test_parenting.rb +0 -89
  322. data/vendor/gems/suitcase/LICENSE +0 -20
  323. data/vendor/gems/suitcase/README.rdoc +0 -31
  324. data/vendor/gems/suitcase/Rakefile +0 -57
  325. data/vendor/gems/suitcase/VERSION.yml +0 -4
  326. data/vendor/gems/suitcase/lib/suitcase/unzipper.rb +0 -15
  327. data/vendor/gems/suitcase/lib/suitcase/zipper.rb +0 -119
  328. data/vendor/gems/suitcase/lib/suitcase.rb +0 -5
  329. data/vendor/gems/suitcase/suitcase.gemspec +0 -32
  330. data/vendor/gems/suitcase/test/suitcase_test.rb +0 -102
  331. data/vendor/gems/suitcase/test/test_dir/box.rb +0 -1
  332. data/vendor/gems/suitcase/test/test_dir/test.txt +0 -1
  333. data/vendor/gems/suitcase/test/test_helper.rb +0 -12
@@ -0,0 +1,165 @@
1
+ =begin rdoc
2
+ The Vmrun remote base uses the vmrun command to implement a cloud remoter base.
3
+ The Vmrun remoter base has been tested with Vmware fusion on the mac.
4
+
5
+ In order to use the Vmrun remoter base you will need to setup a few things.
6
+ First, you will need to have the Vmware fusion installed and vmrun command in your path.
7
+ The default location of the vmrun binary is /Library/Application Support/VMware Fusion/vmrun.
8
+ You will then of course need a virtual machine installed and available.
9
+ Once you have your instance installed and running, you need to setup your ssh keys so that poolparty can ssh into the instance. Get the ip of you instnace with ifconfig inside the running instance.
10
+ For example:
11
+
12
+ ssh root@172.0.1.129 "mkdir /root/.ssh && chmod 600 /root/.ssh"
13
+ scp my_key.pub root@172.0.1.129:/root/.ssh/authorized_keys
14
+
15
+ provide a using :vmrun block in your clouds.rb
16
+ for example:
17
+
18
+ using :vmrun do
19
+ vmx_hash(::File.expand_path("~/Documents/Virtual\ Machines.localized/Ubuntu-jaunty.vmwarevm/Ubuntu-jaunty.vmx") => '172.16.68.129')
20
+ end
21
+
22
+ The vmx file fulfills a similar purpose as the ami id in ec2. Note that expand path. vmrun return fuill paths, so we must provide full paths so things match up later. W
23
+ Vmrun does not provide a meta server like ec2 has, so you need to list the ip address of your VM. For this reason it is recommended that you use NAT addressing on your VM to maintain consistent addressing across different physical networks.
24
+
25
+ Also, note that vmrun does not copy the VM to a new distinct VM on each run, so if you want to be able to start from a known state, you should make a snapshot before using your vm with poolparty. Then, you can rollback to this initial state if you want to ensure you can repeat a fresh cloud-start.
26
+
27
+ =end
28
+
29
+ module PoolParty
30
+ module Remote
31
+ class Vmrun < Remote::RemoterBase
32
+ include Dslify
33
+
34
+ default_options(
35
+ :path_to_binary => 'vmrun',
36
+ :images_repo_path => ::File.expand_path("~/Documents/Virtual_Machines.localized/"),
37
+ :default_cli_options => 'gui',
38
+ :terminate_options => 'soft',
39
+ :vmx_hash => 'need to specify vmx_files to use'
40
+ )
41
+
42
+ def initialize(par, opts={}, &block)
43
+ dsl_options opts
44
+ instance_eval &block if block
45
+ super(par, &block)
46
+ end
47
+
48
+ #terminate all running instances
49
+ def self.terminate!(o={})
50
+ describe_instances(o).each do |vmxf|
51
+ terminate_instance! o.merge(:vmx_file => vmxf)
52
+ end
53
+ end
54
+
55
+ def self.launch_new_instance!(o={})
56
+ new_instance(o).launch_new_instance!
57
+ end
58
+ def launch_new_instance!(o={})
59
+ VmwareInstance.new( :vmx_file => next_unused_vmx_file,
60
+ :ip => vmx_hash[next_unused_vmx_file],
61
+ :keypair => @cloud.keypair
62
+ ).launch!
63
+ end
64
+ # Terminate an instance by id
65
+ def self.terminate_instance!(o={})
66
+ new(nil, o).terminate_instance!
67
+ end
68
+ def terminate_instance!(o={})
69
+ dsl_options o
70
+ VmwareInstance.new( :vmx_file => last_unused_vmx_file,
71
+ :ip => vmx_hash[last_unused_vmx_file],
72
+ :keypair => @cloud.keypair
73
+ ).terminate!(terminate_options)
74
+ end
75
+
76
+ # Describe an instance's status, must pass :vmx_file in the options
77
+ def self.describe_instance(o={})
78
+ # vmx_file = o[:vmx_file] || Vmrun.running_instances.first
79
+ new_instance(o).describe_instance
80
+ end
81
+ def describe_instance(o={})
82
+ running_instances.select {|inst| inst.vmx_file == o[:vmx_file] }.first
83
+ end
84
+
85
+ def self.describe_instances(o={})
86
+ new_instance(o).describe_instances
87
+ end
88
+ def describe_instances(o={})
89
+ running_instances.map {|a| a.to_hash }
90
+ end
91
+
92
+ # After launch callback
93
+ # This is called after a new instance is launched
94
+ def after_launched(force=false)
95
+ puts "new vmware instance was launched"
96
+ end
97
+
98
+ # Before shutdown callback
99
+ # This is called before the cloud is contracted
100
+ def before_shutdown
101
+ end
102
+ def self.path_to_binary
103
+ new(parent).path_to_binary
104
+ end
105
+
106
+ def after_launch_instance(inst=nil)
107
+ if inst
108
+ dputs "Associate address after launched: #{inst.ip}"
109
+ end
110
+ end
111
+
112
+ private
113
+ def self.new_instance(o={})
114
+ Vmrun.new((cloud rescue o), o)
115
+ end
116
+
117
+ def running_instances(o={})
118
+ output = run_local "#{path_to_binary} list"
119
+ lines = output.split("\n")
120
+ lines.shift
121
+ lines.map {|vmx_file| VmwareInstance.new( :vmx_file => vmx_file,
122
+ :ip => vmx_hash[vmx_file],
123
+ :keypair => @cloud.keypair
124
+ ) }
125
+ end
126
+
127
+ # vmrun specific methods
128
+ def self.run_local(cmd, o={:raise_on_error=>false, :verbose=>true})
129
+ output = `#{cmd}`
130
+ unless $?.success?
131
+ $stderr.puts "FAILED: #{cmd}\n code = #{$?}"
132
+ raise "ERROR: run_local" if o[:raise_on_error]
133
+ end
134
+ output
135
+ end
136
+
137
+ def run_local(cmd, o={:raise_on_error=>false, :verbose=>true})
138
+ self.class.run_local(cmd, o)
139
+ end
140
+
141
+ def next_unused_vmx_file
142
+ tmp = (vmx_files - running_instances.map {|a| a.vmx_file })
143
+ (tmp.empty? ? vmx_files : tmp).first
144
+ end
145
+
146
+ def last_unused_vmx_file
147
+ running_instances.last.vmx_file
148
+ end
149
+
150
+ def vmx_files
151
+ vmx_hash.keys
152
+ end
153
+
154
+ def id(vfile)
155
+ vmx_file(vfile)
156
+ end
157
+
158
+ ## method's to override default RemoteInstance
159
+ def instance_id
160
+ vmx_file
161
+ end
162
+
163
+ end
164
+ end
165
+ end
@@ -0,0 +1,71 @@
1
+ module PoolParty
2
+ module Remote
3
+
4
+ class VmwareInstance
5
+ attr_reader :ip, :mac_address, :vmx_file, :keypair, :cloud
6
+
7
+ def initialize(o={}, cld=nil)
8
+ raise "You must pass a vmx_file" unless o[:vmx_file]
9
+ @vmx_file = ::File.expand_path(o[:vmx_file])
10
+ @ip = o[:ip]
11
+ @keypair = o[:keypair]
12
+
13
+ @cloud = cld
14
+ end
15
+
16
+ def to_hash
17
+ {
18
+ :status => status,
19
+ :mac_addresses => mac_address,
20
+ :ip => ip,
21
+ :instance_id => vmx_file,
22
+ :internal_ip => ip,
23
+ :keypair => keypair
24
+ }
25
+ end
26
+ def status
27
+ "running"
28
+ end
29
+ # Is this instance running?
30
+ def running?
31
+ true
32
+ end
33
+ # Is this instance pending?
34
+ def pending?
35
+ false
36
+ end
37
+ # Is this instance terminating?
38
+ def terminating?
39
+ false
40
+ end
41
+ # Has this instance been terminated?
42
+ def terminated?
43
+ false
44
+ end
45
+ def launch!
46
+ Vmrun.run_local("#{Vmrun.path_to_binary} start \"#{vmx_file}\"")
47
+ dputs "Launched new vmware instance from vmx: #{vmx_file}"
48
+ to_hash
49
+ end
50
+ def terminate!(o)
51
+ Vmrun.run_local("#{Vmrun.path_to_binary} stop \"#{vmx_file}\" #{o}")
52
+ end
53
+ # Get the ip from the arp -a
54
+ # def ip
55
+ # @ip ||= %x[arp -a].select {|a| a if a =~ /#{mac_address.macify}/}.first[/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/]
56
+ # end
57
+ # Get the mac address in the vmx_file
58
+ def mac_address
59
+ @mac_address ||= parse_vmx_file[:"ethernet0.generatedAddress"]
60
+ end
61
+ def parse_vmx_file
62
+ vmx_data.to_hash
63
+ end
64
+ def vmx_data
65
+ @vmx_data ||= open(vmx_file).read
66
+ end
67
+
68
+ end
69
+
70
+ end
71
+ end
@@ -1,6 +1,6 @@
1
1
  module PoolParty
2
2
  class Base
3
- plugin :poolparty_base_bind do
3
+ plugin :bind do
4
4
 
5
5
  def enable
6
6
 
@@ -1,21 +1,26 @@
1
1
  require "tempfile"
2
+ # BIG TODO: Slim the place where the content is gathered from
2
3
  module PoolParty
3
4
  class ChefRecipe
4
5
  include Dslify
5
6
  end
6
7
  class Chef
7
8
  define_resource :chef_recipe do
8
- def loaded o={}, &block
9
- puts "Added chef_recipe virtual_resource"
9
+ end
10
+ define_resource :chef_library do
11
+ end
12
+
13
+ plugin :include_chef_recipe do
14
+ def loaded(opts={}, &block)
15
+ parent.has_chef_recipe ::File.basename(name)
16
+ end
17
+ def before_configure
18
+ ::Suitcase::Zipper.add(name, "chef/cookbooks") if ::File.exist?(name)
10
19
  end
11
20
  end
12
21
 
13
22
  plugin :chef do
14
- def before_load(o, &block)
15
- bootstrap_gems "chef", "ohai"
16
- bootstrap_commands [
17
- "mkdir -p /etc/chef/cookbooks /etc/chef/cache"
18
- ]
23
+ def before_load(o, &block)
19
24
  end
20
25
 
21
26
  def loaded o={}, &block
@@ -26,25 +31,28 @@ module PoolParty
26
31
  end
27
32
 
28
33
  def basedir
29
- @basedir ||= "#{Default.tmp_path}/dr_configure/chef/recipes/main"
34
+ @basedir ||= "#{Default.tmp_path}/dr_configure/chef/cookbooks/main"
30
35
  end
31
36
 
32
- def recipe file=nil, o={}, &block
37
+ def recipe(file=nil, o={}, &block)
33
38
  if file
34
- ::FileUtils.mkdir_p "#{basedir}/recipes" unless ::File.directory? basedir
35
-
39
+ file = ::File.expand_path(file)
40
+ ::FileUtils.mkdir_p "#{basedir}/recipes"
41
+
36
42
  unless ::File.file?(file)
37
43
  tfile = Tempfile.new("main-poolparty-recipe")
38
44
  tfile << file # copy the string into the temp file
39
45
  file = tfile.path
40
46
  end
41
-
47
+ ::FileUtils.rm "#{basedir}/recipes/default.rb" if ::File.file?("#{basedir}/recipes/default.rb")
42
48
  ::File.cp file, "#{basedir}/recipes/default.rb"
43
49
 
44
50
  templates o[:templates] if o[:templates]
45
51
 
46
52
  recipe_files << basedir
53
+ # ::Suitcase::Zipper.add(basedir, "chef/cookbooks")
47
54
  # TODO: Enable neat syntax from within poolparty
55
+
48
56
  else
49
57
  raise <<-EOR
50
58
  PoolParty currently only supports passing recipes as files. Please specify a file in your chef block and try again"
@@ -52,46 +60,44 @@ module PoolParty
52
60
  end
53
61
  end
54
62
 
55
- def templates templates=[]
63
+ def templates(templates=[])
56
64
  if templates
57
65
  ::FileUtils.mkdir_p "#{basedir}/templates/default/"
58
66
  templates.each do |f|
67
+ f = ::File.expand_path(f)
59
68
  if ::File.file?(f)
60
69
  ::File.cp f, "#{basedir}/templates/default/#{::File.basename(f)}"
61
70
  elsif ::File.directory?(f)
62
- Dir["#{f}/*"].each {|f| ::File.cp f, "#{basedir}/templates/default/#{::File.basename(f)}" }
71
+ Dir["#{f}/**"].each {|f| ::File.cp f, "#{basedir}/templates/default/#{::File.basename(f)}" }
63
72
  else
64
73
  tfile = Tempfile.new("main-poolparty-recipe")
65
74
  tfile << f # copy the string into the temp file
66
75
  ::File.cp tfile.path, "#{basedir}/templates/default/#{::File.basename(f)}"
67
- end
76
+ end
68
77
  end
69
78
  end
70
79
  end
71
80
 
72
81
  def json file=nil, &block
73
- if @json_file
74
- @json_file
75
- else
76
- if file
77
- if ::File.file? file
78
- ::File.cp file, "#{Default.tmp_path}/dr_configure/dna.json"
79
- elsif file.is_a?(String)
80
- ::File.open("#{Default.tmp_path}/dr_configure/dna.json", "w+"){|tf| tf << file } # is really a string
81
- else
82
- raise <<-EOM
83
- Your json must either point to a file that exists or a string. Please check your configuration and try again
84
- EOM
85
- end
86
- @json_file = "#{Default.tmp_path}/dr_configure/dna.json"
82
+ if file
83
+ if ::File.file? file
84
+ ::Suitcase::Zipper.add_content_as(open(file).read, "dna.json", "chef")
85
+ elsif file.is_a?(String)
86
+ ::Suitcase::Zipper.add_content_as(file, "dna.json", "chef")
87
87
  else
88
- unless @recipe
89
- @recipe = ChefRecipe.new
90
- @recipe.instance_eval &block if block
91
- @recipe.recipes(recipe_files.empty? ? ["poolparty"] : ["poolparty", "main"])
92
- ::File.open("#{Default.tmp_path}/dr_configure/dna.json", "w+") {|f| f << @recipe.options.to_json }
93
- @json_file = "#{Default.tmp_path}/dr_configure/dna.json"
94
- end
88
+ raise <<-EOM
89
+ Your json must either point to a file that exists or a string. Please check your configuration and try again
90
+ EOM
91
+ end
92
+ else
93
+ unless @recipe
94
+ @recipe = ChefRecipe.new
95
+ @recipe.instance_eval &block if block
96
+ @recipe.recipes(recipe_files.empty? ? ["poolparty"] : ["poolparty", "main"])
97
+ # ::File.open("#{Default.tmp_path}/dr_configure/dna.json", "w+") {|f| f << @recipe.options.to_json }
98
+ ::Suitcase::Zipper.add_content_as(@recipe.options.to_json, "dna.json", "chef")
99
+
100
+ configure_commands ["cp -f /var/poolparty/dr_configure/chef/dna.json /etc/chef/dna.json"]
95
101
  end
96
102
  end
97
103
  end
@@ -99,37 +105,39 @@ module PoolParty
99
105
  def include_recipes *recps
100
106
  unless recps.empty?
101
107
  recps.each do |rcp|
102
- Dir[::File.expand_path(rcp)].each do |f|
103
- added_recipes << f
108
+ Dir[::File.expand_path(rcp)].each do |f|
109
+ included_recipes << f
104
110
  end
105
111
  end
106
112
  end
107
113
  end
108
114
 
115
+ def included_recipes
116
+ @included_recipes ||= []
117
+ end
118
+
109
119
  def config file=""
110
- if @config_file
111
- @config_file
120
+ if ::File.file? file
121
+ ::Suitcase::Zipper.add_content_as(open(file).read, "solo.rb", "chef")
112
122
  else
113
- if ::File.file? file
114
- @config_file = file
115
- else
116
- conf_string = if file.empty?
123
+ conf_string = if file.empty?
117
124
  # default config
118
- <<-EOE
125
+ <<-EOE
119
126
  cookbook_path "/etc/chef/cookbooks"
120
127
  node_path "/etc/chef/nodes"
121
128
  log_level :info
122
129
  file_store_path "/etc/chef"
123
130
  file_cache_path "/etc/chef"
124
- EOE
125
- else
126
- open(file).read
127
- end
128
- ::File.open("#{Default.tmp_path}/dr_configure/chef_config.rb", "w+") do |tf|
129
- tf << conf_string
130
- end
131
- @config_file = "#{Default.tmp_path}/dr_configure/chef_config.rb"
131
+ EOE
132
+ else
133
+ open(file).read
132
134
  end
135
+ # ::FileUtils.mkdir_p "#{Default.tmp_path}/trash" unless ::File.directory? "#{Default.tmp_path}/trash"
136
+ # ::File.open("#{Default.tmp_path}/trash/solo.rb", "w+") do |tf|
137
+ # tf << conf_string
138
+ # end
139
+ ::Suitcase::Zipper.add_content_as(conf_string, "solo.rb", "chef")
140
+ # ::Suitcase::Zipper.add("#{Default.tmp_path}/trash/solo.rb", "chef")
133
141
  end
134
142
  end
135
143
 
@@ -137,34 +145,26 @@ file_cache_path "/etc/chef"
137
145
  @added_recipes ||= []
138
146
  end
139
147
 
140
- def after_create
141
- before_configure
148
+ def before_bootstrap
149
+ bootstrap_gems "chef", "ohai"
150
+ bootstrap_commands [
151
+ "mkdir -p /etc/chef/cookbooks /etc/chef/cache"
152
+ ]
142
153
  end
143
-
144
154
  def before_configure
145
155
  config
146
156
  json
147
157
 
158
+ included_recipes.each do |f|
159
+ ::Suitcase::Zipper.add(f, "chef/cookbooks")
160
+ end
161
+
148
162
  if ::File.directory?("/etc/chef")
149
- ::Suitcase::Zipper.add("/etc/chef/cookbooks/*", "chef/recipes")
163
+ ::Suitcase::Zipper.add("/etc/chef/cookbooks/*", "chef/cookbooks")
150
164
  ::Suitcase::Zipper.add("/etc/chef/dna.json", "chef/json")
151
165
  ::Suitcase::Zipper.add("/etc/chef/solo.rb", "chef/")
152
166
  end
153
167
 
154
- ::Suitcase::Zipper.add(@config_file, "chef")
155
- added_recipes.each do |rcp|
156
- # ::FileUtils.cp_r rcp, "/tmp/poolparty/dr_configure/recipes/"
157
- ::Suitcase::Zipper.add(rcp, "chef/recipes")
158
- end
159
-
160
- ::Suitcase::Zipper.add(@json_file, "chef/json")
161
- configure_commands ["cp -f /var/poolparty/dr_configure/chef/json/dna.json /etc/chef/dna.json"]
162
-
163
- recipe_files.each do |rf|
164
- ::FileUtils.mkdir_p "/tmp/poolparty/dr_configure/recipes/#{::File.basename(rf)}"
165
- ::FileUtils.cp_r rf, "/tmp/poolparty/dr_configure/recipes/#{::File.basename(rf)}"
166
- # ::Suitcase::Zipper.add(rf, "chef/recipes")
167
- end
168
168
  end
169
169
 
170
170
  end
@@ -0,0 +1,58 @@
1
+ =begin rdoc
2
+ Chef deploy (ezmobius http://github.com/ezmobius/chef-deploy/tree/master)
3
+
4
+ deploy "/data/#{app}" do
5
+ repo "git://github.com/engineyard/rack-app.git"
6
+ branch "HEAD"
7
+ user "ez"
8
+ enable_submodules true
9
+ migrate true
10
+ migration_command "rake db:migrate"
11
+ environment "production"
12
+ shallow_clone true
13
+ revision '0xbeadbeef'
14
+ action :deploy # or :rollback
15
+ end
16
+
17
+ =end
18
+ module PoolParty
19
+ class ChefDeploy
20
+
21
+ define_resource :chef_deploy_definition do
22
+
23
+ default_options(
24
+ :branch => "HEAD",
25
+ :enable_submodules => true,
26
+ :migrate => true,
27
+ :environment => "production",
28
+ :shallow_clone => true,
29
+ :user => "www-data",
30
+ :restart_command => "touch tmp/restart.txt",
31
+ :migration_command => "rake db:migrate"
32
+ )
33
+ def present
34
+ :deploy
35
+ end
36
+ end
37
+
38
+ plugin :chef_deploy do
39
+
40
+ def loaded(o={})
41
+ raise "You must specify a git repo" unless repo?
42
+ has_chef_library :name => "chef-deploy/lib/chef-deploy.rb"
43
+ has_chef_deploy_definition(options)
44
+ end
45
+
46
+ def before_configure
47
+ configure_commands [
48
+ "mkdir -p /etc/chef/lib",
49
+ "cp -R /var/poolparty/dr_configure/etc/chef/lib /etc/chef"
50
+ ]
51
+ ::Suitcase::Zipper.add("#{::File.dirname(__FILE__)}/../../../vendor/chef/chef-deploy",
52
+ "etc/chef/lib")
53
+ end
54
+
55
+ end
56
+
57
+ end
58
+ end
@@ -15,21 +15,30 @@ module PoolParty
15
15
  virtual_resource(:deploy_directory) do
16
16
 
17
17
  def loaded(opts={}, &block)
18
- package_deploy_directory
19
18
  add_unpack_directory
20
19
  end
21
20
 
21
+ def before_configure
22
+ package_deploy_directory
23
+ end
24
+
22
25
  def package_deploy_directory
23
- ::Suitcase::Zipper.add("#{from}", "user_directory/")
26
+ ::Suitcase::Zipper.add("#{::File.expand_path(from)}", "user_directory/")
24
27
  end
25
28
 
26
29
  def add_unpack_directory
27
30
  has_directory("#{::File.dirname(to)}")
28
31
  has_exec("unpack-#{::File.basename(to)}-deploy-directory") do
29
32
  requires get_directory("#{::File.dirname(to)}")
30
- not_if "test -f #{to}"
31
33
  command "cp -R /var/poolparty/dr_configure/user_directory/#{name}/* #{to}"
32
34
  end
35
+
36
+ if owner?
37
+ has_exec(:name => "chown-#{name}") do
38
+ command "chown #{owner} -R #{to}/#{name}"
39
+ end
40
+ end
41
+
33
42
  end
34
43
 
35
44
  end
@@ -0,0 +1,14 @@
1
+ module PoolParty
2
+ class Base
3
+ plugin :dynomite do
4
+
5
+ def enable
6
+ has_exec "install dynomite" do
7
+ command "git clone git://github.com/cliffmoon/dynomite.git && cd dynomite && git submodule init && git submodule update && rake"
8
+ not_if "which tcrtest"
9
+ end
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,37 @@
1
+ module PoolParty
2
+
3
+ # Allows you to specify a gem to be installed
4
+ # You can optionally pass a :download_url if you want a specific gem or version installed
5
+ # example:
6
+ # has_gem_package :name => 'rubot', :download_url => 'http://rubyforge.org/frs/download.php/35089/rubot-base-0.0.1.gem'
7
+
8
+ class GempackageResource
9
+
10
+ virtual_resource(:gem_package) do
11
+
12
+ def loaded(opts={}, &block)
13
+ if download_url?
14
+ has_exec(
15
+ :name => "download-#{name}",
16
+ :cwd => Default.remote_storage_path,
17
+ :command => "wget #{download_url} -O #{name}.gem",
18
+ :if_not => "test -f #{Default.remote_storage_path}/#{name}.gem"
19
+ )
20
+ has_exec(
21
+ :name => "install-#{name}-gem",
22
+ :command => "gem install --no-ri --no-rdoc #{Default.remote_storage_path}/#{name}.gem",
23
+ :if_not => "gem list --local #{name} | grep #{name} #{"| grep #{version}" if version?}",
24
+ :requires => "download-#{name}"
25
+ )
26
+ else
27
+ has_exec(
28
+ :name => "#{name}",
29
+ :command => "gem install --no-ri --no-rdoc #{"--version #{version}" if version?} #{"--source #{source}" if source?} #{name}",
30
+ :if_not => "gem list --local #{name} | grep #{name} #{"| grep #{version}" if version?}"
31
+ )
32
+ end
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -5,6 +5,7 @@ module PoolParty
5
5
  def loaded(opts={}, &block)
6
6
  has_exec "line_in_#{file}" do
7
7
  command "grep -q \'#{line.safe_quote}\' #{file} || echo \'#{line.safe_quote}\' >> #{file}"
8
+ not_if "grep -q \'#{line.safe_quote}\' #{file}"
8
9
  end
9
10
  end
10
11
  end
@@ -0,0 +1,41 @@
1
+ module PoolParty
2
+ class Nanite
3
+
4
+ plugin :nanite do
5
+
6
+ def loaded(o={}, &block)
7
+ has_package "erlang"
8
+
9
+ # TODO: change this with has_gem_package
10
+ has_exec "install nanite rubygem" do
11
+ command "cd ~ && git clone git://github.com/ezmobius/nanite.git && cd nanite/ && rake gem && gem install pkg/nanite*.gem"
12
+ not_if "gem list -l | grep nanite"
13
+ end
14
+
15
+ has_gem_package "eventmachine"
16
+ has_gem_package "amqp"
17
+
18
+ has_package "python"
19
+
20
+ has_exec "install easy_install" do
21
+ command "cd ~ && wget http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c9-py2.5.egg && sh setuptools-0.6c9-py2.5.egg"
22
+ not_if "which easy_install"
23
+ end
24
+
25
+ has_exec "install simplejson" do
26
+ command "cd ~ && easy_install simplejson"
27
+ end
28
+
29
+ has_exec "install rabbitmq" do
30
+ command "cd ~ && wget http://www.rabbitmq.com/releases/rabbitmq-server/v1.5.3/rabbitmq-server-1.5.3.tar.gz && cd /usr/local/lib/erlang/lib && tar -zxf ~/rabbitmq-server-1.5.3.tar.gz && cd rabbitmq-server-1.5.3 && make"
31
+ not_if "which easy_install"
32
+ end
33
+
34
+ has_gem_package "ezmobius-nanite"
35
+
36
+ end
37
+
38
+ end
39
+
40
+ end
41
+ end