fairchild-poolparty 1.1.5 → 1.2.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (385) hide show
  1. data/History.txt +3 -0
  2. data/README.txt +13 -9
  3. data/Rakefile +0 -1
  4. data/VERSION.yml +2 -2
  5. data/bin/cloud +43 -46
  6. data/bin/cloud-bootstrap +33 -23
  7. data/bin/cloud-configure +33 -34
  8. data/bin/cloud-console +31 -9
  9. data/bin/cloud-contract +27 -11
  10. data/bin/cloud-expand +32 -19
  11. data/bin/cloud-list +43 -15
  12. data/bin/cloud-osxcopy +22 -12
  13. data/bin/cloud-provision +39 -24
  14. data/bin/cloud-run +37 -0
  15. data/bin/cloud-setup-dev +31 -20
  16. data/bin/cloud-show +40 -21
  17. data/bin/cloud-ssh +24 -15
  18. data/bin/cloud-start +33 -19
  19. data/bin/cloud-terminate +34 -15
  20. data/bin/cloud-verify +41 -0
  21. data/bin/install-poolparty +22 -0
  22. data/bin/server-cloud-elections +17 -23
  23. data/bin/server-list-active +23 -22
  24. data/bin/server-manage-election +14 -23
  25. data/bin/server-show-stats +1 -1
  26. data/config/jeweler.rb +6 -6
  27. data/examples/basic.rb +13 -14
  28. data/examples/fairchild.rb +25 -20
  29. data/examples/maize.rb +37 -0
  30. data/examples/metavirt_cloud.rb +33 -0
  31. data/examples/simple.rb +13 -0
  32. data/examples/vmrun_cloud.rb +17 -0
  33. data/lib/poolparty/{aska/aska.rb → aska.rb} +3 -0
  34. data/lib/poolparty/core/array.rb +13 -1
  35. data/lib/poolparty/core/exception.rb +1 -1
  36. data/lib/poolparty/core/hash.rb +63 -2
  37. data/lib/poolparty/core/integer.rb +11 -0
  38. data/lib/poolparty/core/object.rb +41 -19
  39. data/lib/poolparty/core/proc.rb +0 -7
  40. data/lib/poolparty/core/string.rb +35 -2
  41. data/lib/poolparty/core/symbol.rb +10 -0
  42. data/lib/poolparty/core/time.rb +6 -0
  43. data/lib/poolparty/dependency_resolver/chef_resolver.rb +40 -41
  44. data/lib/poolparty/dependency_resolver/dependency_resolver.rb +1 -1
  45. data/lib/poolparty/dependency_resolver/dependency_resolver_cloud_extensions.rb +6 -6
  46. data/lib/poolparty/dependency_resolver/puppet.rb +0 -1
  47. data/lib/poolparty/dependency_resolver/puppet_resolver.rb +14 -48
  48. data/lib/poolparty/exceptions/MasterException.rb +2 -2
  49. data/lib/poolparty/extra/duration.rb +96 -0
  50. data/lib/poolparty/helpers/binary.rb +1 -1
  51. data/lib/poolparty/helpers/console.rb +0 -5
  52. data/lib/poolparty/helpers/optioner.rb +18 -13
  53. data/lib/poolparty/installers/base_installer.rb +113 -0
  54. data/lib/poolparty/installers/ec2.rb +141 -0
  55. data/lib/poolparty/installers/vmrun.rb +144 -0
  56. data/lib/poolparty/lite.rb +5 -2
  57. data/lib/poolparty/modules/callbacks.rb +15 -2
  58. data/lib/poolparty/modules/cloud_dsl.rb +10 -8
  59. data/lib/poolparty/modules/cloud_resourcer.rb +39 -59
  60. data/lib/poolparty/modules/daemonizable.rb +4 -5
  61. data/lib/poolparty/modules/definable_resource.rb +6 -7
  62. data/lib/poolparty/modules/file_writer.rb +2 -2
  63. data/lib/poolparty/modules/output.rb +2 -2
  64. data/lib/poolparty/modules/pinger.rb +9 -2
  65. data/lib/poolparty/modules/pretty_printer.rb +1 -1
  66. data/lib/poolparty/modules/resourcing_dsl.rb +1 -29
  67. data/lib/poolparty/modules/searchable_paths.rb +100 -0
  68. data/lib/poolparty/modules/user_helpers.rb +1 -1
  69. data/lib/poolparty/monitors/base_monitor.rb +65 -0
  70. data/lib/poolparty/monitors/monitor_daemon.rb +168 -0
  71. data/lib/poolparty/monitors/monitor_rack.rb +29 -15
  72. data/lib/poolparty/monitors/monitors/{time_monitor.rb → clock_monitor.rb} +7 -2
  73. data/lib/poolparty/monitors/monitors/cloud_monitor.rb +36 -0
  74. data/lib/poolparty/monitors/monitors/elections_monitor.rb +76 -0
  75. data/lib/poolparty/monitors/monitors/neighborhood_monitor.rb +15 -12
  76. data/lib/poolparty/monitors/monitors/stats_monitor.rb +68 -49
  77. data/lib/poolparty/net/init.rb +12 -7
  78. data/lib/poolparty/net/remote_instance.rb +48 -64
  79. data/lib/poolparty/net/remoter/cloud_control.rb +0 -177
  80. data/lib/poolparty/net/remoter/connections.rb +19 -14
  81. data/lib/poolparty/net/remoter/interactive.rb +30 -24
  82. data/lib/poolparty/net/remoter_base.rb +140 -48
  83. data/lib/poolparty/net/remoter_bases/ec2/ec2.rb +119 -71
  84. data/lib/poolparty/net/remoter_bases/ec2/ec2_remote_instance.rb +42 -31
  85. data/lib/poolparty/net/remoter_bases/ec2/ec2_response_object.rb +75 -10
  86. data/lib/poolparty/net/remoter_bases/libvirt/libvirt.rb +73 -0
  87. data/lib/poolparty/net/remoter_bases/libvirt/libvirt_instance.rb +64 -0
  88. data/lib/poolparty/net/remoter_bases/metavirt/metavirt.rb +110 -0
  89. data/lib/poolparty/net/remoter_bases/metavirt/metavirt_instance.rb +37 -0
  90. data/lib/poolparty/net/remoter_bases/vmrun/utilities/vm_disk.rb +1 -1
  91. data/lib/poolparty/net/remoter_bases/vmrun/utilities/vmx.rb +1 -1
  92. data/lib/poolparty/net/remoter_bases/vmrun/utilities/vmx_file.rb +117 -117
  93. data/lib/poolparty/net/remoter_bases/vmrun/vmrun.rb +59 -43
  94. data/lib/poolparty/net/remoter_bases/vmrun/vmrun_instance.rb +37 -21
  95. data/lib/poolparty/plugins/apache2/apache.rb +266 -0
  96. data/lib/poolparty/plugins/apache2/passenger_site.rb +86 -0
  97. data/lib/poolparty/plugins/apache2/php5.rb +40 -0
  98. data/lib/poolparty/plugins/apache2/virtual_host.rb +53 -0
  99. data/lib/poolparty/plugins/authorized_key.rb +29 -0
  100. data/lib/poolparty/plugins/bind.rb +5 -6
  101. data/lib/poolparty/plugins/{chef.rb → chef/chef.rb} +32 -44
  102. data/lib/poolparty/plugins/chef/chef_deploy.rb +55 -0
  103. data/lib/poolparty/plugins/chef/chef_deploy_definition.rb +32 -0
  104. data/lib/poolparty/plugins/chef/chef_library.rb +7 -0
  105. data/lib/poolparty/plugins/chef/chef_recipe.rb +7 -0
  106. data/lib/poolparty/plugins/chef/include_chef_recipe.rb +14 -0
  107. data/lib/poolparty/plugins/deploy_directory.rb +41 -26
  108. data/lib/poolparty/plugins/gem_package.rb +42 -14
  109. data/lib/poolparty/plugins/git.rb +62 -33
  110. data/lib/poolparty/{base_packages → plugins}/haproxy.rb +21 -20
  111. data/lib/poolparty/plugins/heartbeat.rb +16 -0
  112. data/lib/poolparty/plugins/host.rb +39 -0
  113. data/lib/poolparty/plugins/line_in_file.rb +24 -2
  114. data/lib/poolparty/plugins/plugin_template.rb +13 -0
  115. data/lib/poolparty/{base_packages/poolparty.rb → plugins/poolparty_base_packages.rb} +4 -6
  116. data/lib/poolparty/plugins/rails_deploy.rb +128 -0
  117. data/lib/poolparty/{base_packages → plugins}/ruby.rb +3 -3
  118. data/lib/poolparty/plugins/runit.rb +17 -92
  119. data/lib/poolparty/plugins/sshkey.rb +50 -0
  120. data/lib/poolparty/plugins/svn.rb +10 -8
  121. data/lib/poolparty/poolparty/cloud.rb +224 -61
  122. data/lib/poolparty/poolparty/default.rb +22 -15
  123. data/lib/poolparty/poolparty/key.rb +19 -28
  124. data/lib/poolparty/poolparty/neighborhoods.rb +16 -5
  125. data/lib/poolparty/poolparty/plugin.rb +49 -13
  126. data/lib/poolparty/poolparty/pool.rb +32 -9
  127. data/lib/poolparty/poolparty/poolparty_base_class.rb +65 -45
  128. data/lib/poolparty/poolparty/resource.rb +24 -49
  129. data/lib/poolparty/poolparty/service.rb +11 -9
  130. data/lib/poolparty/provision/boot_strapper.rb +48 -37
  131. data/lib/poolparty/provision/configurations/chef.rb +6 -5
  132. data/lib/poolparty/provision/dr_configure.rb +25 -19
  133. data/lib/poolparty/resources/cron.rb +37 -4
  134. data/lib/poolparty/resources/directory.rb +30 -0
  135. data/lib/poolparty/resources/exec.rb +31 -1
  136. data/lib/poolparty/resources/file.rb +54 -12
  137. data/lib/poolparty/resources/group.rb +21 -0
  138. data/lib/poolparty/resources/mount.rb +24 -4
  139. data/lib/poolparty/resources/package.rb +30 -6
  140. data/lib/poolparty/resources/remote_file.rb +33 -1
  141. data/lib/poolparty/resources/service.rb +22 -1
  142. data/lib/poolparty/resources/symlink.rb +37 -2
  143. data/lib/poolparty/resources/user.rb +25 -0
  144. data/lib/poolparty/resources/variable.rb +26 -1
  145. data/lib/poolparty/resources.rb +42 -0
  146. data/lib/poolparty/schema.rb +6 -8
  147. data/lib/poolparty/templates/apache2/apache2.conf +14 -0
  148. data/lib/poolparty/templates/apache2/base.conf.erb +168 -0
  149. data/lib/poolparty/templates/apache2/browser_fixes.conf.erb +26 -0
  150. data/lib/poolparty/templates/apache2/debian.conf.erb +675 -0
  151. data/lib/poolparty/templates/apache2/default-site.conf.erb +41 -0
  152. data/lib/poolparty/templates/apache2/directory_indexes.conf.erb +101 -0
  153. data/lib/poolparty/templates/apache2/logging-syslog.conf.erb +42 -0
  154. data/lib/poolparty/templates/apache2/mime-extras.conf.erb +211 -0
  155. data/lib/poolparty/templates/apache2/mime-minimal.conf.erb +15 -0
  156. data/lib/poolparty/templates/apache2/mpm-worker.conf.erb +20 -0
  157. data/lib/poolparty/templates/apache2/mpm-worker.erb +20 -0
  158. data/lib/poolparty/templates/apache2/passenger.conf.erb +20 -0
  159. data/lib/poolparty/templates/apache2/php.ini.erb +1253 -0
  160. data/lib/poolparty/templates/apache2/server-status.erb +19 -0
  161. data/lib/poolparty/templates/{gemrc → gemrc_template} +0 -0
  162. data/lib/poolparty/templates/haproxy.conf +2 -2
  163. data/lib/poolparty/templates/monitor.ru +13 -0
  164. data/lib/poolparty/templates/php.ini.erb +1253 -0
  165. data/lib/poolparty/verification/verifier_base.rb +10 -0
  166. data/lib/poolparty/verification/verifiers/http_match.rb +43 -0
  167. data/lib/poolparty/verification/verifiers/http_status.rb +59 -0
  168. data/lib/poolparty/verification/verifiers/ping.rb +18 -1
  169. data/lib/poolparty/verification/verify.rb +6 -0
  170. data/lib/poolparty.rb +14 -15
  171. data/lib/poolpartycl.rb +1 -1
  172. data/spec/bin/bin_spec_helper.rb +1 -0
  173. data/spec/bin/fixtures/bin_cloud_for_test.rb +0 -6
  174. data/spec/bin/server-list-active_spec.rb +4 -6
  175. data/spec/poolparty/core/object_spec.rb +1 -62
  176. data/spec/poolparty/core/ordered_hash_spec.rb +7 -7
  177. data/spec/poolparty/core/string_spec.rb +1 -1
  178. data/spec/poolparty/dependency_resolver/chef_resolver_spec.rb +0 -8
  179. data/spec/poolparty/dependency_resolver/dependency_resolver_cloud_extensions_spec.rb +35 -32
  180. data/spec/poolparty/extra/deployments_spec.rb +68 -68
  181. data/spec/poolparty/fixtures/clouds.json +1 -1
  182. data/spec/poolparty/fixtures/fake_key.pub +1 -0
  183. data/spec/poolparty/helpers/optioner_spec.rb +4 -11
  184. data/spec/poolparty/modules/cloud_resourcer_spec.rb +1 -1
  185. data/spec/poolparty/modules/searchable_paths_spec.rb +83 -0
  186. data/spec/poolparty/net/remote_instance_spec.rb +1 -2
  187. data/spec/poolparty/net/remoter_base_spec.rb +7 -11
  188. data/spec/poolparty/net/remoter_bases/ec2_mocks_and_stubs.rb +9 -11
  189. data/spec/poolparty/net/remoter_bases/ec2_remote_instance_spec.rb +6 -56
  190. data/spec/poolparty/net/remoter_bases/ec2_spec.rb +10 -7
  191. data/spec/poolparty/net/remoter_spec.rb +2 -3
  192. data/spec/poolparty/plugins/authorized_key_spec.rb +23 -0
  193. data/spec/poolparty/plugins/deploydirectory_spec.rb +64 -51
  194. data/spec/poolparty/plugins/git_spec.rb +8 -10
  195. data/spec/poolparty/poolparty/cloud_spec.rb +61 -64
  196. data/spec/poolparty/poolparty/configurers/files/ruby_basic.rb +2 -4
  197. data/spec/poolparty/poolparty/configurers/files/ruby_plugins.rb +1 -1
  198. data/spec/poolparty/poolparty/configurers/ruby_spec.rb +1 -6
  199. data/spec/poolparty/poolparty/default_spec.rb +23 -22
  200. data/spec/poolparty/poolparty/example_spec.rb +47 -26
  201. data/spec/poolparty/{base_packages → poolparty}/haproxy_spec.rb +1 -1
  202. data/spec/poolparty/{base_packages → poolparty}/heartbeat_spec.rb +1 -1
  203. data/spec/poolparty/poolparty/key_spec.rb +2 -2
  204. data/spec/poolparty/poolparty/neighborhoods_spec.rb +1 -1
  205. data/spec/poolparty/poolparty/plugin_model_spec.rb +13 -17
  206. data/spec/poolparty/poolparty/plugin_spec.rb +7 -7
  207. data/spec/poolparty/poolparty/pool_spec.rb +4 -10
  208. data/spec/poolparty/poolparty/resource_spec.rb +25 -29
  209. data/spec/poolparty/poolparty/script_spec.rb +1 -4
  210. data/spec/poolparty/poolparty/test_plugins/webserver.rb +27 -25
  211. data/spec/poolparty/resources/file_spec.rb +5 -4
  212. data/spec/poolparty/resources/sshkey_spec.rb +39 -40
  213. data/spec/poolparty/spec_helper.rb +9 -39
  214. data/tasks/poolparty.rake +29 -1
  215. data/tasks/spec.rake +39 -1
  216. data/test/fixtures/fake_clouds.rb +11 -0
  217. data/test/fixtures/metavirt_cloud.json +1 -0
  218. data/test/fixtures/test_key +1 -0
  219. data/test/poolparty/core/array_test.rb +11 -0
  220. data/test/poolparty/core/hash_test.rb +5 -7
  221. data/test/poolparty/core/object_test.rb +29 -0
  222. data/test/poolparty/dependency_resolver/chef_resolver_test.rb +82 -0
  223. data/test/poolparty/dependency_resolver/puppet_resolver_test.rb +5 -26
  224. data/test/poolparty/modules/callbacks_test.rb +1 -1
  225. data/test/poolparty/modules/cloud_dsl_test.rb +10 -8
  226. data/test/poolparty/monitors/test_base_monitor.rb +17 -0
  227. data/test/poolparty/monitors/test_monitor_rack.rb +26 -0
  228. data/test/poolparty/net/remoter_base_test.rb +17 -0
  229. data/test/poolparty/net/remoter_bases/libvirt/libvirt_test.rb +70 -0
  230. data/test/poolparty/net/remoter_bases/metavirt/metavirt_test.rb +81 -0
  231. data/test/poolparty/net/remoter_bases/vmrun/vmrun_test.rb +58 -27
  232. data/test/poolparty/plugins/chef_deploy_test.rb +37 -0
  233. data/test/poolparty/plugins/chef_plugin_test.rb +23 -0
  234. data/test/poolparty/plugins/rails_deploy_test.rb +50 -0
  235. data/test/poolparty/poolparty/cloud_test.rb +65 -0
  236. data/test/poolparty/poolparty/isolated_cloud_test.rb +25 -0
  237. data/test/poolparty/poolparty/neighborhood_test.rb +1 -1
  238. data/test/poolparty/poolparty/plugin_test.rb +19 -0
  239. data/test/poolparty/poolparty/pool_test.rb +22 -0
  240. data/test/poolparty/poolparty/poolparty_base_class_test.rb +53 -15
  241. data/test/poolparty/poolparty/schema_test.rb +13 -0
  242. data/test/poolparty/poolparty/template_test.rb +6 -6
  243. data/test/poolparty/verification/verify_test.rb +7 -3
  244. data/test/test_helper.rb +15 -4
  245. data/test/test_methods.rb +11 -0
  246. data/vendor/chef/apache2/attributes/apache.rb +1 -1
  247. data/vendor/gems/dslify/LICENSE +20 -0
  248. data/vendor/gems/dslify/README.rdoc +33 -0
  249. data/vendor/gems/dslify/Rakefile +56 -0
  250. data/vendor/gems/dslify/VERSION.yml +4 -0
  251. data/vendor/gems/dslify/dslify.gemspec +29 -0
  252. data/vendor/gems/dslify/lib/dslify.rb +81 -0
  253. data/vendor/gems/dslify/test/dslify_test.rb +283 -0
  254. data/vendor/gems/dslify/test/test_helper.rb +7 -0
  255. data/vendor/gems/git-style-binaries/README.markdown +280 -0
  256. data/vendor/gems/git-style-binaries/Rakefile +64 -0
  257. data/vendor/gems/git-style-binaries/VERSION.yml +4 -0
  258. data/vendor/gems/git-style-binaries/doc/EXAMPLES +1 -0
  259. data/vendor/gems/git-style-binaries/doc/gsb-screencast.png +0 -0
  260. data/vendor/gems/git-style-binaries/doc/poolparty-binaries.screenplay +412 -0
  261. data/vendor/gems/git-style-binaries/git-style-binaries.gemspec +78 -0
  262. data/vendor/gems/git-style-binaries/lib/ext/colorize.rb +198 -0
  263. data/vendor/gems/git-style-binaries/lib/ext/core.rb +16 -0
  264. data/vendor/gems/git-style-binaries/lib/git-style-binary/autorunner.rb +21 -0
  265. data/vendor/gems/git-style-binaries/lib/git-style-binary/command.rb +204 -0
  266. data/vendor/gems/git-style-binaries/lib/git-style-binary/commands/help.rb +32 -0
  267. data/vendor/gems/git-style-binaries/lib/git-style-binary/helpers/name_resolver.rb +78 -0
  268. data/vendor/gems/git-style-binaries/lib/git-style-binary/helpers/pager.rb +37 -0
  269. data/vendor/gems/git-style-binaries/lib/git-style-binary/parser.rb +223 -0
  270. data/vendor/gems/git-style-binaries/lib/git-style-binary.rb +88 -0
  271. data/vendor/gems/git-style-binaries/test/fixtures/flickr +4 -0
  272. data/vendor/gems/git-style-binaries/test/fixtures/flickr-download +17 -0
  273. data/vendor/gems/git-style-binaries/test/fixtures/wordpress +42 -0
  274. data/vendor/gems/git-style-binaries/test/fixtures/wordpress-categories +18 -0
  275. data/vendor/gems/git-style-binaries/test/fixtures/wordpress-list +18 -0
  276. data/vendor/gems/git-style-binaries/test/fixtures/wordpress-post +26 -0
  277. data/vendor/gems/git-style-binaries/test/git-style-binary/command_test.rb +17 -0
  278. data/vendor/gems/git-style-binaries/test/git_style_binary_test.rb +21 -0
  279. data/vendor/gems/git-style-binaries/test/running_binaries_test.rb +224 -0
  280. data/vendor/gems/git-style-binaries/test/shoulda_macros/matching_stdio.rb +13 -0
  281. data/vendor/gems/git-style-binaries/test/test_helper.rb +28 -0
  282. data/vendor/gems/parenting/History.txt +4 -0
  283. data/vendor/gems/parenting/Manifest.txt +14 -0
  284. data/vendor/gems/parenting/PostInstall.txt +2 -0
  285. data/vendor/gems/parenting/README.rdoc +47 -0
  286. data/vendor/gems/parenting/Rakefile +28 -0
  287. data/vendor/gems/parenting/lib/parenting/parenting.rb +70 -0
  288. data/vendor/gems/parenting/lib/parenting.rb +10 -0
  289. data/vendor/gems/parenting/parenting.gemspec +39 -0
  290. data/vendor/gems/parenting/script/console +10 -0
  291. data/vendor/gems/parenting/script/destroy +14 -0
  292. data/vendor/gems/parenting/script/generate +14 -0
  293. data/vendor/gems/parenting/test/file_to_eval.rb +9 -0
  294. data/vendor/gems/parenting/test/test_helper.rb +5 -0
  295. data/vendor/gems/parenting/test/test_parenting.rb +117 -0
  296. data/vendor/gems/suitcase/LICENSE +20 -0
  297. data/vendor/gems/suitcase/README.rdoc +31 -0
  298. data/vendor/gems/suitcase/Rakefile +57 -0
  299. data/vendor/gems/suitcase/VERSION.yml +4 -0
  300. data/vendor/gems/suitcase/lib/suitcase/unzipper.rb +15 -0
  301. data/vendor/gems/suitcase/lib/suitcase/zipper.rb +167 -0
  302. data/vendor/gems/suitcase/lib/suitcase.rb +5 -0
  303. data/vendor/gems/suitcase/suitcase.gemspec +32 -0
  304. data/vendor/gems/suitcase/test/suitcase_test.rb +108 -0
  305. data/vendor/gems/suitcase/test/test_dir/box.rb +1 -0
  306. data/vendor/gems/suitcase/test/test_dir/gems/famoseagle-carrot-0.6.0.gem +0 -0
  307. data/vendor/gems/suitcase/test/test_dir/test.txt +1 -0
  308. data/vendor/gems/suitcase/test/test_helper.rb +12 -0
  309. data/vendor/gems/trollop/FAQ.txt +35 -0
  310. data/vendor/gems/trollop/History.txt +97 -0
  311. data/vendor/gems/trollop/Manifest.txt +7 -0
  312. data/vendor/gems/trollop/README.txt +40 -0
  313. data/vendor/gems/trollop/Rakefile +36 -0
  314. data/vendor/gems/trollop/lib/trollop.rb +735 -0
  315. data/vendor/gems/trollop/release-script.txt +13 -0
  316. data/vendor/gems/trollop/test/test_trollop.rb +1042 -0
  317. data/vendor/gems/trollop/www/index.html +167 -0
  318. metadata +205 -150
  319. data/bin/cloud-describe +0 -28
  320. data/bin/cloud-handle-load +0 -27
  321. data/bin/cloud-rsync +0 -28
  322. data/bin/cloud-spec +0 -41
  323. data/bin/messenger-get-current-nodes +0 -14
  324. data/bin/server-become-master +0 -24
  325. data/bin/server-build-messenger +0 -28
  326. data/bin/server-clean-cert-for +0 -15
  327. data/bin/server-provision +0 -32
  328. data/bin/server-start-agent +0 -15
  329. data/bin/server-start-client +0 -29
  330. data/bin/server-start-master +0 -26
  331. data/bin/server-start-node +0 -32
  332. data/bin/server-stop-client +0 -3
  333. data/bin/server-stop-master +0 -3
  334. data/bin/server-stop-node +0 -3
  335. data/bin/server-update-hosts +0 -49
  336. data/examples/poolparty.rb +0 -12
  337. data/lib/poolparty/base_packages/heartbeat.rb +0 -58
  338. data/lib/poolparty/base_packages/runit.rb +0 -21
  339. data/lib/poolparty/capistrano/cloud_tasks.rb +0 -10
  340. data/lib/poolparty/capistrano.rb +0 -54
  341. data/lib/poolparty/config/postlaunchmessage.txt +0 -5
  342. data/lib/poolparty/core/metaid.rb +0 -15
  343. data/lib/poolparty/core/module.rb +0 -40
  344. data/lib/poolparty/extra/deployments.rb +0 -31
  345. data/lib/poolparty/helpers/display.rb +0 -30
  346. data/lib/poolparty/net/messenger.rb +0 -57
  347. data/lib/poolparty/net/remote_bases.rb +0 -21
  348. data/lib/poolparty/plugins/chef_deploy.rb +0 -58
  349. data/lib/poolparty/plugins/dynomite.rb +0 -14
  350. data/lib/poolparty/plugins/nanite.rb +0 -41
  351. data/lib/poolparty/plugins/rsyncmirror.rb +0 -28
  352. data/lib/poolparty/plugins/tokyo_tyrant.rb +0 -23
  353. data/lib/poolparty/poolparty/plugin_model.rb +0 -45
  354. data/lib/poolparty/resources/host.rb +0 -16
  355. data/lib/poolparty/resources/sshkey.rb +0 -27
  356. data/lib/poolparty/services/conditional.rb +0 -46
  357. data/lib/poolparty/spec/core/string.rb +0 -18
  358. data/lib/poolparty/spec/matchers/a_spec_extensions_base.rb +0 -26
  359. data/lib/poolparty/spec/matchers/have_cron.rb +0 -28
  360. data/lib/poolparty/spec/matchers/have_deploydirectory.rb +0 -15
  361. data/lib/poolparty/spec/matchers/have_directory.rb +0 -31
  362. data/lib/poolparty/spec/matchers/have_exec.rb +0 -28
  363. data/lib/poolparty/spec/matchers/have_file.rb +0 -28
  364. data/lib/poolparty/spec/matchers/have_gempackage.rb +0 -28
  365. data/lib/poolparty/spec/matchers/have_git.rb +0 -28
  366. data/lib/poolparty/spec/matchers/have_host.rb +0 -28
  367. data/lib/poolparty/spec/matchers/have_mount.rb +0 -28
  368. data/lib/poolparty/spec/matchers/have_package.rb +0 -28
  369. data/lib/poolparty/spec/matchers/have_remotefile.rb +0 -28
  370. data/lib/poolparty/spec/matchers/have_rsyncmirror.rb +0 -28
  371. data/lib/poolparty/spec/matchers/have_service.rb +0 -28
  372. data/lib/poolparty/spec/matchers/have_sshkey.rb +0 -28
  373. data/lib/poolparty/spec/matchers/have_symlink.rb +0 -28
  374. data/lib/poolparty/spec/matchers/have_variable.rb +0 -32
  375. data/lib/poolparty/spec/spec/dynamic_matchers.rb +0 -63
  376. data/lib/poolparty/spec/spec/ensure_matchers_exist.rb +0 -7
  377. data/lib/poolparty/spec/templates/have_base.rb +0 -28
  378. data/lib/poolparty/spec.rb +0 -31
  379. data/spec/poolparty/core/module_spec.rb +0 -15
  380. data/spec/poolparty/helpers/display_spec.rb +0 -13
  381. data/spec/poolparty/id_rsa +0 -27
  382. data/spec/poolparty/net/messenger_spec.rb +0 -16
  383. data/spec/poolparty/resources/host_spec.rb +0 -35
  384. data/spec/poolparty/services/conditional_spec.rb +0 -52
  385. data/spec/poolparty/spec/core/string_spec.rb +0 -57
@@ -1,6 +1,38 @@
1
1
  module PoolParty
2
2
  module Resources
3
3
 
4
+ =begin rdoc
5
+
6
+ == Remote File
7
+
8
+ The remotefile resource is used to describe a file that is hosted on the master instance and propagated to the other instances
9
+
10
+ == Usage
11
+
12
+ has_remotefile(:name => '...') do
13
+ # More options.
14
+ # This block is optional
15
+ end
16
+
17
+ == Options
18
+
19
+ * <tt>name</tt> Describe the location of the file with the name
20
+ * <tt>mode</tt> Describe the mode of the file (default: 644)
21
+ * <tt>owner</tt> The owner of the file (default: poolparty user)
22
+ * <tt>content</tt> The contents of the file
23
+ * <tt>source</tt> Used to describe a file that is hosted on the master instance.
24
+ * <tt>template</tt> The file contents are described with the template. The location given must be readable
25
+
26
+ To write a file to the template directory, use:
27
+
28
+ copy_template_to_storage_directory(filepath)
29
+
30
+ == Example
31
+ has_remotefile(:name => "/etc/haproxy.cfg") do
32
+ mode 644
33
+ template File.join(File.dirname(__FILE__), "..", "templates/haproxy.conf")
34
+ end
35
+ =end
4
36
  class Remotefile < Resource
5
37
 
6
38
  default_options({
@@ -11,7 +43,7 @@ module PoolParty
11
43
  })
12
44
 
13
45
  def source(arg=nil)
14
- arg ? options[:source] = arg : "#{Default.fileserver_base}/#{::File.basename(name)}"
46
+ arg ? dsl_options[:source] = arg : "#{Default.fileserver_base}/#{::File.basename(name)}"
15
47
  end
16
48
 
17
49
  end
@@ -1,10 +1,31 @@
1
1
  module PoolParty
2
2
  module Resources
3
3
 
4
+ =begin rdoc
5
+ == Service
6
+
7
+ The service resource specifies a service that must be running on the nodes
8
+
9
+ == Usage
10
+
11
+ has_service(:name => '...') do
12
+ # More options.
13
+ # This block is optional
14
+ end
15
+
16
+ == Options
17
+
18
+ * <tt>name</tt> Name of the service to be running
19
+
20
+ == Examples
21
+
22
+ has_service(:name => "apache2")
23
+ =end
4
24
  class Service < Resource
5
25
 
26
+ dsl_methods :name # Name of the service
27
+
6
28
  default_options({
7
- :ensures => "enable",
8
29
  :enable => true
9
30
  })
10
31
 
@@ -1,10 +1,45 @@
1
1
  module PoolParty
2
2
  module Resources
3
3
 
4
+ =begin rdoc
5
+
6
+ == Symlink
7
+
8
+ The symlink resource sets a symlink
9
+
10
+ == Usage
11
+
12
+ has_symlink(:name => 'target', :source=>'/where/to' ) do
13
+ # More options.
14
+ # This block is optional
15
+ end
16
+
17
+ == Options
18
+
19
+ * <tt>name</tt> The location of the symlink (target)
20
+ * <tt>source</tt> The source of the symlink, the existing file or directory
21
+
22
+ == Examples
23
+
24
+ puppet style:
25
+ has_symlink(:name => "/var/www/poolpartyrb.com/public", :source => "/var/www/poolpartyrb.com/poolparty-website/site")
26
+ chef style:
27
+ has_symlink(:to => "/var/www/poolpartyrb.com/public", :target_file => "/var/www/poolpartyrb.com/poolparty-website/site")
28
+ =end
4
29
  class Symlink < Resource
5
30
 
6
- def initialize *args, &block
7
- super
31
+ dsl_methods :source,
32
+ :to,
33
+ :target_file
34
+
35
+ default_options :link_type => :symbolic
36
+
37
+ def present
38
+ :create
39
+ end
40
+
41
+ def absent
42
+ :delete!
8
43
  end
9
44
 
10
45
  end
@@ -3,9 +3,34 @@ module PoolParty
3
3
 
4
4
  class User < Resource
5
5
 
6
+ dsl_methods :name, # Name of the user
7
+ :password, # Password for the user
8
+ :home, # Home directory
9
+ :gid, # primary group for user
10
+ :authorized_keys
11
+
12
+
6
13
  default_options({
7
14
  :shell => "/bin/sh"
8
15
  })
16
+
17
+ def loaded(o={})
18
+ @group = dsl_options.delete(:group)
19
+ end
20
+
21
+ def after_create
22
+ if authorized_keys
23
+ cloud.has_file :name=>"/home/#{name}/.ssh/authorized_keys", :content => authorized_keys
24
+ end
25
+ end
26
+
27
+ def present
28
+ :create
29
+ end
30
+
31
+ def absent
32
+ :remove
33
+ end
9
34
 
10
35
  end
11
36
 
@@ -1,8 +1,33 @@
1
1
  module PoolParty
2
2
  module Resources
3
3
 
4
+ =begin rdoc
5
+ == Variable
6
+
7
+ Describes a variable to use in a template. One of the powerful hidden features behind puppet is that you can use templating for your templates
8
+
9
+ == Usage
10
+
11
+ has_variable(:name => '...') do
12
+ # More options.
13
+ # This block is optional
14
+ end
15
+
16
+ == Options
17
+
18
+ * <tt>name</tt> The name of the variable to use in the template
19
+ * <tt>value</tt> The value of the variable in the template
20
+
21
+ To use these variables, in your Erb template, reference them like so
22
+
23
+ name: <%= variablename %>
24
+
25
+ == Examples
26
+
27
+ has_variable(:name => "name", :value => "#{cloud.name}")
28
+ =end
4
29
  class Variable < Resource
5
-
30
+ dsl_methods :name, :value
6
31
  end
7
32
 
8
33
  end
@@ -0,0 +1,42 @@
1
+ module PoolParty
2
+ =begin rdoc
3
+
4
+ Resources are items that poolparty can make available in your clouds.
5
+ Resources are used in the <tt>clouds.rb</tt>, and in Plugins.
6
+ Plugins are collections of resources.
7
+
8
+ All of these resources can be defined as <tt>has_resource</tt> and <tt>does_not_have_resource</tt>:
9
+
10
+ * <tt>has_</tt>
11
+ example <tt>has_file(...)</tt>
12
+ * <tt>does_not_have_</tt>
13
+ For example: <tt>does_not_have_file(...)</tt>
14
+
15
+ == Resources
16
+
17
+
18
+ see PoolParty::Resources::File
19
+
20
+ * +has_file+ PoolParty::Resources::File
21
+ * +has_package+ PoolParty::Resources::Package
22
+ * +has_gempackage+ PoolParty::Resources::GempackageResource
23
+ * +has_exec+ PoolParty::Resources::Exec
24
+ * +has_variable+ (for templates) PoolParty::Resources::Variable
25
+ * +has_line_in_file+ PoolParty::Resources::LineInFile
26
+ * +has_remotefile+ PoolParty::Resources::Remotefile
27
+ * +hash_cron+ PoolParty::Resources::Cron
28
+ * +has_host+ PoolParty::Resources::Host
29
+ * +has_service+ PoolParty::Resources::Service
30
+ * +has_symlink+ PoolParty::Resources::Symlink
31
+ * +has_directory+ PoolParty::Resources::Directory
32
+ * +has_deploy_directory+ PoolParty::Resources::Deploydirectory
33
+ * +has_mount+ PoolParty::Resources::Mount
34
+
35
+ == Helper methods
36
+ * execute_if
37
+
38
+ =end
39
+
40
+ module Resources
41
+ end
42
+ end
@@ -27,7 +27,7 @@ module PoolParty
27
27
  hsh[k.to_sym] = self.class.new(v)
28
28
  else
29
29
  hsh[k.to_sym] = v
30
- end
30
+ end
31
31
  end
32
32
 
33
33
  def to_hash
@@ -50,19 +50,17 @@ module PoolParty
50
50
 
51
51
  def to_cloud(node={})
52
52
  require "ostruct"
53
-
53
+
54
54
  $pool_specfile = "/etc/poolparty/clouds.rb"
55
55
 
56
- remoter_base = PoolParty::Remote.module_eval(options.remote_base.split('::')[-1].camelcase)
57
- # TODO: Seriously, make this sexier
58
-
56
+ # TODO: Seriously, make this sexier
59
57
  cld = OpenStruct.new(options)
60
58
  cld.keypair = ::PoolParty::Key.new("/etc/poolparty/#{node[:keypair]}")
61
- cld.remoter_base = remoter_base
59
+ # cld.remoter_base = PoolParty::Remote.module_eval( schema.options.remoter_base.camelcase )
60
+ cld.remote_base = PoolParty::Remote.module_eval( self.options.remoter_base.camelcase )
62
61
  cld.build_and_store_new_config_file = "/etc/poolparty/clouds.json"
63
62
  cld.dependency_resolver = PoolParty.module_eval(options.dependency_resolver.split("::")[-1].camelcase).send(:new)
64
-
65
- cld
63
+
66
64
  end
67
65
  end
68
66
  end
@@ -0,0 +1,14 @@
1
+ # apache2.conf -- version for puppet-controlled installations
2
+ #
3
+ # this config file merely includes other files; all the truly important stuff
4
+ # is configured in one of these directories.
5
+
6
+ # Include module configuration:
7
+ Include /etc/apache2/mods-enabled/*.load
8
+ Include /etc/apache2/mods-enabled/*.conf
9
+
10
+ # Include generic snippets of statements
11
+ Include /etc/apache2/conf.d/*.conf
12
+
13
+ # Include the virtual host configurations:
14
+ Include /etc/apache2/sites-enabled/
@@ -0,0 +1,168 @@
1
+ #
2
+ # Based upon the NCSA server configuration files originally by Rob McCool.
3
+ #
4
+ # This is the main Apache server configuration file. It contains the
5
+ # configuration directives that give the server its instructions.
6
+ # See <URL:http://httpd.apache.org/docs-2.1/> for detailed information about
7
+ # the directives.
8
+ #
9
+ # Do NOT simply read the instructions in here without understanding
10
+ # what they do. They're here only as hints or reminders. If you are unsure
11
+ # consult the online docs. You have been warned.
12
+ #
13
+ # The configuration directives are grouped into three basic sections:
14
+ # 1. Directives that control the operation of the Apache server process as a
15
+ # whole (the 'global environment').
16
+ # 2. Directives that define the parameters of the 'main' or 'default' server,
17
+ # which responds to requests that aren't handled by a virtual host.
18
+ # These directives also provide default values for the settings
19
+ # of all virtual hosts.
20
+ # 3. Settings for virtual hosts, which allow Web requests to be sent to
21
+ # different IP addresses or hostnames and have them handled by the
22
+ # same Apache server process.
23
+ #
24
+ # Configuration and logfile names: If the filenames you specify for many
25
+ # of the server's control files begin with "/" (or "drive:/" for Win32), the
26
+ # server will use that explicit path. If the filenames do *not* begin
27
+ # with "/", the value of ServerRoot is prepended -- so "/var/log/apache2/foo.log"
28
+ # with ServerRoot set to "" will be interpreted by the
29
+ # server as "//var/log/apache2/foo.log".
30
+ #
31
+
32
+ ### Section 1: Global Environment
33
+ #
34
+ # The directives in this section affect the overall operation of Apache,
35
+ # such as the number of concurrent requests it can handle or where it
36
+ # can find its configuration files.
37
+ #
38
+
39
+ #
40
+ # ServerRoot: The top of the directory tree under which the server's
41
+ # configuration, error, and log files are kept.
42
+ #
43
+ # NOTE! If you intend to place this on an NFS (or otherwise network)
44
+ # mounted filesystem then please read the LockFile documentation (available
45
+ # at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
46
+ # you will save yourself a lot of trouble.
47
+ #
48
+ # Do NOT add a slash at the end of the directory path.
49
+ #
50
+ ServerRoot "/etc/apache2"
51
+
52
+ #
53
+ # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
54
+ #
55
+ #<IfModule !mpm_winnt.c>
56
+ #<IfModule !mpm_netware.c>
57
+ LockFile /var/lock/apache2/accept.lock
58
+ #</IfModule>
59
+ #</IfModule>
60
+
61
+ #
62
+ # PidFile: The file in which the server should record its process
63
+ # identification number when it starts.
64
+ #
65
+ PidFile /var/run/apache2.pid
66
+
67
+ #
68
+ # Timeout: The number of seconds before receives and sends time out.
69
+ #
70
+ Timeout 300
71
+
72
+ #
73
+ # KeepAlive: Whether or not to allow persistent connections (more than
74
+ # one request per connection). Set to "Off" to deactivate.
75
+ #
76
+ KeepAlive On
77
+
78
+ #
79
+ # MaxKeepAliveRequests: The maximum number of requests to allow
80
+ # during a persistent connection. Set to 0 to allow an unlimited amount.
81
+ # We recommend you leave this number high, for maximum performance.
82
+ #
83
+ MaxKeepAliveRequests 100
84
+
85
+ #
86
+ # KeepAliveTimeout: Number of seconds to wait for the next request from the
87
+ # same client on the same connection.
88
+ #
89
+ KeepAliveTimeout 15
90
+
91
+
92
+ User www-data
93
+ Group www-data
94
+
95
+ #
96
+ # AccessFileName: The name of the file to look for in each directory
97
+ # for additional configuration directives. See also the AllowOverride
98
+ # directive.
99
+ #
100
+
101
+ AccessFileName .htaccess
102
+
103
+ #
104
+ # The following lines prevent .htaccess and .htpasswd files from being
105
+ # viewed by Web clients.
106
+ #
107
+ <Files ~ "^\.ht">
108
+ Order allow,deny
109
+ Deny from all
110
+ </Files>
111
+
112
+ TypesConfig /etc/mime.types
113
+
114
+ #
115
+ # DefaultType is the default MIME type the server will use for a document
116
+ # if it cannot otherwise determine one, such as from filename extensions.
117
+ # If your server contains mostly text or HTML documents, "text/plain" is
118
+ # a good value. If most of your content is binary, such as applications
119
+ # or images, you may want to use "application/octet-stream" instead to
120
+ # keep browsers from trying to display binary files as though they are
121
+ # text.
122
+ #
123
+ DefaultType text/plain
124
+
125
+
126
+ #
127
+ # HostnameLookups: Log the names of clients or just their IP addresses
128
+ # e.g., www.apache.org (on) or 204.62.129.132 (off).
129
+ # The default is off because it'd be overall better for the net if people
130
+ # had to knowingly turn this feature on, since enabling it means that
131
+ # each client request will result in AT LEAST one lookup request to the
132
+ # nameserver.
133
+ #
134
+ HostnameLookups Off
135
+
136
+ #
137
+ # ServerTokens
138
+ # This directive configures what you return as the Server HTTP response
139
+ # Header. The default is 'Full' which sends information about the OS-Type
140
+ # and compiled in modules.
141
+ # Set to one of: Full | OS | Minor | Minimal | Major | Prod
142
+ # where Full conveys the most information, and Prod the least.
143
+ #
144
+ ServerTokens Prod
145
+
146
+ #
147
+ # Optionally add a line containing the server version and virtual host
148
+ # name to server-generated pages (internal error documents, FTP directory
149
+ # listings, mod_status and mod_info output etc., but not CGI generated
150
+ # documents or custom error documents).
151
+ # Set to "EMail" to also include a mailto: link to the ServerAdmin.
152
+ # Set to one of: On | Off | EMail
153
+ #
154
+ ServerSignature Off
155
+
156
+ DirectoryIndex index.html
157
+
158
+ ErrorLog /var/log/apache2/error.log
159
+ LogLevel warn
160
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
161
+ LogFormat "%h %l %u %t \"%r\" %>s %b" common
162
+ LogFormat "%{Referer}i -> %U" referer
163
+ LogFormat "%{User-agent}i" agent
164
+
165
+ DocumentRoot /var/www
166
+
167
+ Listen <%= @node[:poolparty][:port] %>
168
+ NameVirtualHost *:<%= @node[:poolparty][:port] %>
@@ -0,0 +1,26 @@
1
+ <IfModule mod_setenvif.c>
2
+ #
3
+ # The following directives modify normal HTTP response behavior to
4
+ # handle known problems with browser implementations.
5
+ #
6
+ BrowserMatch "Mozilla/2" nokeepalive
7
+ BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
8
+ BrowserMatch "RealPlayer 4\.0" force-response-1.0
9
+ BrowserMatch "Java/1\.0" force-response-1.0
10
+ BrowserMatch "JDK/1\.0" force-response-1.0
11
+
12
+ #
13
+ # The following directive disables redirects on non-GET requests for
14
+ # a directory that does not include the trailing slash. This fixes a
15
+ # problem with Microsoft WebFolders which does not appropriately handle
16
+ # redirects for folders with DAV methods.
17
+ # Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
18
+ #
19
+ BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
20
+ BrowserMatch "MS FrontPage" redirect-carefully
21
+ BrowserMatch "^WebDrive" redirect-carefully
22
+ BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
23
+ BrowserMatch "^gnome-vfs/1.0" redirect-carefully
24
+ BrowserMatch "^XML Spy" redirect-carefully
25
+ BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
26
+ </IfModule>