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.
- data/README.txt +0 -12
- data/Rakefile +17 -1
- data/VERSION.yml +1 -1
- data/bin/cloud +20 -1
- data/bin/cloud-bootstrap +14 -4
- data/bin/cloud-configure +26 -9
- data/bin/cloud-contract +7 -7
- data/bin/cloud-describe +28 -0
- data/bin/cloud-expand +13 -6
- data/bin/cloud-list +3 -5
- data/bin/cloud-osxcopy +1 -1
- data/bin/cloud-provision +1 -1
- data/bin/cloud-show +6 -5
- data/bin/cloud-ssh +1 -3
- data/bin/cloud-start +8 -6
- data/bin/cloud-terminate +9 -7
- data/bin/server-cloud-elections +29 -18
- data/bin/server-ensure-provisioning +24 -29
- data/bin/server-list-active +10 -5
- data/bin/server-monitor.ru +18 -1
- data/bin/server-update-hosts +3 -3
- data/bin/server-write-new-nodes +1 -1
- data/config/jeweler.rb +12 -3
- data/lib/poolparty/aska/aska.rb +1 -12
- data/lib/poolparty/base_packages/haproxy.rb +26 -18
- data/lib/poolparty/base_packages/poolparty.rb +1 -1
- data/lib/poolparty/capistrano.rb +1 -1
- data/lib/poolparty/core/array.rb +12 -0
- data/lib/poolparty/core/hash.rb +12 -5
- data/lib/poolparty/core/nil.rb +8 -0
- data/lib/poolparty/core/object.rb +15 -5
- data/lib/poolparty/core/string.rb +28 -2
- data/lib/poolparty/dependency_resolver/chef_resolver.rb +106 -79
- data/lib/poolparty/dependency_resolver/dependency_resolver.rb +1 -1
- data/lib/poolparty/dependency_resolver/dependency_resolver_cloud_extensions.rb +5 -4
- data/lib/poolparty/dependency_resolver/puppet_resolver.rb +44 -17
- data/lib/poolparty/helpers/console.rb +1 -1
- data/lib/poolparty/helpers/optioner.rb +9 -2
- data/lib/poolparty/lite.rb +12 -2
- data/lib/poolparty/modules/callbacks.rb +44 -0
- data/lib/poolparty/modules/cloud_dsl.rb +17 -11
- data/lib/poolparty/modules/cloud_resourcer.rb +29 -21
- data/lib/poolparty/modules/definable_resource.rb +1 -1
- data/lib/poolparty/modules/pinger.rb +28 -0
- data/lib/poolparty/modules/resourcing_dsl.rb +7 -3
- data/lib/poolparty/modules/thread_pool.rb +107 -106
- data/lib/poolparty/modules/user_helpers.rb +20 -0
- data/lib/poolparty/monitors/base_monitor.rb +32 -81
- data/lib/poolparty/monitors/monitor_rack.rb +60 -69
- data/lib/poolparty/monitors/monitors/favicon_monitor.rb +12 -0
- data/lib/poolparty/monitors/monitors/load_monitor.rb +9 -15
- data/lib/poolparty/monitors/monitors/memory_monitor.rb +48 -48
- data/lib/poolparty/monitors/monitors/neighborhood_monitor.rb +77 -0
- data/lib/poolparty/monitors/{stats_monitor.rb → monitors/stats_monitor.rb} +29 -24
- data/lib/poolparty/monitors/monitors/time_monitor.rb +15 -0
- data/lib/poolparty/net/messenger.rb +2 -0
- data/lib/poolparty/net/remoter/cloud_control.rb +177 -227
- data/lib/poolparty/net/remoter/connections.rb +10 -18
- data/lib/poolparty/net/remoter/interactive.rb +24 -90
- data/lib/poolparty/net/remoter_base.rb +98 -25
- data/lib/poolparty/net/remoter_bases/ec2/ec2.rb +83 -66
- data/lib/poolparty/net/remoter_bases/vmrun/utilities/vm_disk.rb +12 -0
- data/lib/poolparty/net/remoter_bases/vmrun/utilities/vmx.rb +33 -0
- data/lib/poolparty/net/remoter_bases/vmrun/utilities/vmx_file.rb +117 -0
- data/lib/poolparty/net/remoter_bases/vmrun/vmrun.rb +165 -0
- data/lib/poolparty/net/remoter_bases/vmrun/vmrun_instance.rb +71 -0
- data/lib/poolparty/{base_packages → plugins}/bind.rb +1 -1
- data/lib/poolparty/plugins/chef.rb +71 -71
- data/lib/poolparty/plugins/chef_deploy.rb +58 -0
- data/lib/poolparty/plugins/{deploydirectory.rb → deploy_directory.rb} +12 -3
- data/lib/poolparty/plugins/dynomite.rb +14 -0
- data/lib/poolparty/plugins/gem_package.rb +37 -0
- data/lib/poolparty/plugins/line_in_file.rb +1 -0
- data/lib/poolparty/plugins/nanite.rb +41 -0
- data/lib/poolparty/{base_packages → plugins}/tokyo_tyrant.rb +1 -1
- data/lib/poolparty/poolparty/cloud.rb +36 -35
- data/lib/poolparty/poolparty/default.rb +2 -11
- data/lib/poolparty/poolparty/key.rb +15 -12
- data/lib/poolparty/poolparty/neighborhoods.rb +54 -21
- data/lib/poolparty/poolparty/plugin.rb +6 -9
- data/lib/poolparty/poolparty/plugin_model.rb +5 -5
- data/lib/poolparty/poolparty/pool.rb +8 -4
- data/lib/poolparty/poolparty/poolparty_base_class.rb +20 -11
- data/lib/poolparty/poolparty/resource.rb +9 -5
- data/lib/poolparty/poolparty/service.rb +3 -1
- data/lib/poolparty/provision/boot_strapper.rb +47 -24
- data/lib/poolparty/provision/configurations/chef.rb +7 -4
- data/lib/poolparty/provision/dr_configure.rb +80 -25
- data/lib/poolparty/resources/cron.rb +8 -0
- data/lib/poolparty/resources/directory.rb +1 -1
- data/lib/poolparty/resources/file.rb +16 -0
- data/lib/poolparty/resources/package.rb +7 -2
- data/lib/poolparty/resources/service.rb +4 -3
- data/lib/poolparty/resources/symlink.rb +0 -8
- data/lib/poolparty/schema.rb +35 -20
- data/lib/poolparty/templates/haproxy.conf +27 -25
- data/lib/poolparty/templates/monitor.ru +3 -3
- data/lib/poolparty/verification/verifier_base.rb +17 -0
- data/lib/poolparty/verification/verifiers/ping.rb +17 -0
- data/lib/poolparty/verification/verify.rb +74 -0
- data/lib/poolparty.rb +8 -9
- data/lib/poolpartycl.rb +14 -0
- data/spec/bin/server-list-active_spec.rb +2 -0
- data/spec/poolparty/base_packages/haproxy_spec.rb +1 -1
- data/spec/poolparty/core/array_spec.rb +3 -1
- data/spec/poolparty/core/ordered_hash_spec.rb +2 -2
- data/spec/poolparty/dependency_resolver/chef_resolver_spec.rb +9 -15
- data/spec/poolparty/dependency_resolver/dependency_resolver_cloud_extensions_spec.rb +6 -6
- data/spec/poolparty/dependency_resolver/puppet_resolver_spec.rb +121 -124
- data/spec/poolparty/net/remote_spec.rb +287 -286
- data/spec/poolparty/net/remoter_bases/ec2_mocks_and_stubs.rb +1 -1
- data/spec/poolparty/net/remoter_bases/ec2_remote_instance_spec.rb +7 -8
- data/spec/poolparty/net/remoter_bases/ec2_spec.rb +22 -7
- data/spec/poolparty/net/remoter_spec.rb +48 -45
- data/spec/poolparty/poolparty/cloud_spec.rb +15 -22
- data/spec/poolparty/poolparty/key_spec.rb +4 -4
- data/spec/poolparty/poolparty/neighborhoods_spec.rb +1 -2
- data/spec/poolparty/poolparty/plugin_spec.rb +2 -2
- data/spec/poolparty/poolparty/resource_spec.rb +4 -5
- data/spec/poolparty/poolparty_base_class_spec.rb +82 -78
- data/spec/poolparty/resources/package_spec.rb +0 -3
- data/spec/poolparty/spec_helper.rb +4 -4
- data/tasks/development.rake +9 -0
- data/test/poolparty/core/array_test.rb +21 -0
- data/test/poolparty/core/hash_test.rb +14 -1
- data/test/poolparty/core/string_test.rb +29 -0
- data/test/poolparty/dependency_resolver/puppet_resolver_test.rb +106 -0
- data/test/poolparty/modules/callbacks_test.rb +40 -0
- data/test/poolparty/modules/cloud_dsl_test.rb +25 -0
- data/test/poolparty/net/remoter_bases/vmrun/vmrun_test.rb +50 -0
- data/test/poolparty/net/remoter_test.rb +14 -0
- data/test/poolparty/poolparty/neighborhood_test.rb +23 -0
- data/test/poolparty/poolparty/poolparty_base_class_test.rb +84 -0
- data/test/poolparty/verification/verify_test.rb +49 -0
- data/test/test_helper.rb +4 -1
- data/test/test_poolparty.rb +6 -5
- data/vendor/chef/apache2/attributes/apache.rb +1 -1
- data/vendor/chef/apache2/templates/default/default-site.erb +1 -1
- data/vendor/chef/chef-deploy/LICENSE +201 -0
- data/vendor/chef/chef-deploy/README.rdoc +24 -0
- data/vendor/chef/chef-deploy/Rakefile +57 -0
- data/vendor/chef/chef-deploy/TODO +4 -0
- data/vendor/chef/chef-deploy/lib/chef-deploy/cached_deploy.rb +230 -0
- data/vendor/chef/chef-deploy/lib/chef-deploy/git.rb +132 -0
- data/vendor/chef/chef-deploy/lib/chef-deploy/subversion.rb +98 -0
- data/vendor/chef/chef-deploy/lib/chef-deploy.rb +183 -0
- metadata +57 -252
- data/bin/cloud-run +0 -18
- data/bin/cloud-stats +0 -17
- data/bin/ec2-list-active +0 -24
- data/bin/pool +0 -31
- data/bin/pool-describe +0 -8
- data/bin/pool-generate +0 -18
- data/bin/pool-init +0 -28
- data/bin/pool-list +0 -30
- data/bin/pool-start +0 -26
- data/bin/server-list-instances +0 -15
- data/lib/erlang/messenger/Emakefile +0 -1
- data/lib/erlang/messenger/Makefile +0 -15
- data/lib/erlang/messenger/README +0 -5
- data/lib/erlang/messenger/Rakefile +0 -72
- data/lib/erlang/messenger/control +0 -11
- data/lib/erlang/messenger/ebin/client.app +0 -19
- data/lib/erlang/messenger/ebin/master.app +0 -19
- data/lib/erlang/messenger/ebin/node.app +0 -19
- data/lib/erlang/messenger/ebin/packager.app +0 -19
- data/lib/erlang/messenger/ebin/pm_client_rel-0.1.rel +0 -1
- data/lib/erlang/messenger/ebin/pm_master_rel-0.1.rel +0 -1
- data/lib/erlang/messenger/ebin/pm_node_rel-0.1.rel +0 -1
- data/lib/erlang/messenger/include/defines.hrl +0 -27
- data/lib/erlang/messenger/lib/eunit/AUTHORS +0 -2
- data/lib/erlang/messenger/lib/eunit/CHANGELOG +0 -14
- data/lib/erlang/messenger/lib/eunit/COPYING +0 -504
- data/lib/erlang/messenger/lib/eunit/Makefile +0 -28
- data/lib/erlang/messenger/lib/eunit/NOTES +0 -276
- data/lib/erlang/messenger/lib/eunit/README +0 -3
- data/lib/erlang/messenger/lib/eunit/doc/edoc-info +0 -3
- data/lib/erlang/messenger/lib/eunit/doc/erlang.png +0 -0
- data/lib/erlang/messenger/lib/eunit/doc/eunit.html +0 -172
- data/lib/erlang/messenger/lib/eunit/doc/index.html +0 -17
- data/lib/erlang/messenger/lib/eunit/doc/modules-frame.html +0 -12
- data/lib/erlang/messenger/lib/eunit/doc/overview-summary.html +0 -984
- data/lib/erlang/messenger/lib/eunit/doc/overview.edoc +0 -980
- data/lib/erlang/messenger/lib/eunit/doc/packages-frame.html +0 -11
- data/lib/erlang/messenger/lib/eunit/doc/stylesheet.css +0 -55
- data/lib/erlang/messenger/lib/eunit/ebin/autoload.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/code_monitor.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit.app +0 -21
- data/lib/erlang/messenger/lib/eunit/ebin/eunit.appup +0 -1
- data/lib/erlang/messenger/lib/eunit/ebin/eunit.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_autoexport.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_data.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_lib.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_proc.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_serial.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_server.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_striptests.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_test.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_tests.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_tty.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/file_monitor.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/examples/eunit_examples.erl +0 -339
- data/lib/erlang/messenger/lib/eunit/examples/fib.erl +0 -19
- data/lib/erlang/messenger/lib/eunit/examples/tests.txt +0 -1
- data/lib/erlang/messenger/lib/eunit/include/eunit.hrl +0 -313
- data/lib/erlang/messenger/lib/eunit/src/Makefile +0 -46
- data/lib/erlang/messenger/lib/eunit/src/autoload.erl +0 -388
- data/lib/erlang/messenger/lib/eunit/src/code_monitor.erl +0 -243
- data/lib/erlang/messenger/lib/eunit/src/eunit.app.src +0 -21
- data/lib/erlang/messenger/lib/eunit/src/eunit.appup.src +0 -1
- data/lib/erlang/messenger/lib/eunit/src/eunit.erl +0 -196
- data/lib/erlang/messenger/lib/eunit/src/eunit_autoexport.erl +0 -102
- data/lib/erlang/messenger/lib/eunit/src/eunit_data.erl +0 -798
- data/lib/erlang/messenger/lib/eunit/src/eunit_internal.hrl +0 -48
- data/lib/erlang/messenger/lib/eunit/src/eunit_lib.erl +0 -682
- data/lib/erlang/messenger/lib/eunit/src/eunit_proc.erl +0 -552
- data/lib/erlang/messenger/lib/eunit/src/eunit_serial.erl +0 -157
- data/lib/erlang/messenger/lib/eunit/src/eunit_server.erl +0 -340
- data/lib/erlang/messenger/lib/eunit/src/eunit_striptests.erl +0 -64
- data/lib/erlang/messenger/lib/eunit/src/eunit_test.erl +0 -334
- data/lib/erlang/messenger/lib/eunit/src/eunit_tests.erl +0 -45
- data/lib/erlang/messenger/lib/eunit/src/eunit_tty.erl +0 -272
- data/lib/erlang/messenger/lib/eunit/src/file_monitor.erl +0 -409
- data/lib/erlang/messenger/lib/eunit/sys.config +0 -9
- data/lib/erlang/messenger/lib/eunit/vsn.mk +0 -1
- data/lib/erlang/messenger/pm_client_rel-0.1.boot +0 -0
- data/lib/erlang/messenger/pm_client_rel-0.1.script +0 -238
- data/lib/erlang/messenger/pm_master_rel-0.1.boot +0 -0
- data/lib/erlang/messenger/pm_master_rel-0.1.script +0 -239
- data/lib/erlang/messenger/pm_node_rel-0.1.boot +0 -0
- data/lib/erlang/messenger/pm_node_rel-0.1.script +0 -237
- data/lib/erlang/messenger/src/client_app.erl +0 -39
- data/lib/erlang/messenger/src/client_server.erl +0 -60
- data/lib/erlang/messenger/src/master_app.erl +0 -39
- data/lib/erlang/messenger/src/node_app.erl +0 -39
- data/lib/erlang/messenger/src/pm_client.erl +0 -49
- data/lib/erlang/messenger/src/pm_client_supervisor.erl +0 -38
- data/lib/erlang/messenger/src/pm_cluster.erl +0 -61
- data/lib/erlang/messenger/src/pm_event_manager.erl +0 -27
- data/lib/erlang/messenger/src/pm_master.erl +0 -215
- data/lib/erlang/messenger/src/pm_master_event_handler.erl +0 -72
- data/lib/erlang/messenger/src/pm_master_supervisor.erl +0 -39
- data/lib/erlang/messenger/src/pm_node.erl +0 -200
- data/lib/erlang/messenger/src/pm_node_supervisor.erl +0 -38
- data/lib/erlang/messenger/src/pm_packager.erl +0 -76
- data/lib/erlang/messenger/src/pm_spawner.erl +0 -213
- data/lib/erlang/messenger/src/pm_strings.erl +0 -11
- data/lib/erlang/messenger/src/utils.erl +0 -72
- data/lib/erlang/messenger/useful_snippets +0 -17
- data/lib/poolparty/monitors/monitors/server_monitor.rb +0 -7
- data/lib/poolparty/monitors/monitors/web_monitor.rb +0 -18
- data/lib/poolparty/monitors/neighborhood_monitor.rb +0 -24
- data/lib/poolparty/monitors.rb +0 -6
- data/lib/poolparty/net/remoter/lists.rb +0 -12
- data/lib/poolparty/poolparty/custom_resource.rb +0 -45
- data/lib/poolparty/resources/custom_service.rb +0 -30
- data/lib/poolparty/services/gem_package.rb +0 -52
- data/lib/poolparty/version.rb +0 -15
- data/spec/poolparty/plugins/svn_spec.rb +0 -16
- data/spec/poolparty/poolparty/custom_resource_spec.rb +0 -79
- data/vendor/gems/butterfly/History.txt +0 -4
- data/vendor/gems/butterfly/PostInstall.txt +0 -2
- data/vendor/gems/butterfly/README.rdoc +0 -48
- data/vendor/gems/butterfly/Rakefile +0 -62
- data/vendor/gems/butterfly/VERSION.yml +0 -4
- data/vendor/gems/butterfly/bin/flutter +0 -4
- data/vendor/gems/butterfly/butterfly.gemspec +0 -37
- data/vendor/gems/butterfly/examples/config.ru +0 -15
- data/vendor/gems/butterfly/examples/my_app.rb +0 -12
- data/vendor/gems/butterfly/lib/butterfly.rb +0 -14
- data/vendor/gems/butterfly/lib/handler.rb +0 -48
- data/vendor/gems/butterfly/lib/request.rb +0 -29
- data/vendor/gems/butterfly/lib/response.rb +0 -49
- data/vendor/gems/butterfly/script/console +0 -10
- data/vendor/gems/butterfly/script/destroy +0 -14
- data/vendor/gems/butterfly/script/generate +0 -14
- data/vendor/gems/butterfly/test/test_adapter_base.rb +0 -23
- data/vendor/gems/butterfly/test/test_butterfly_request.rb +0 -46
- data/vendor/gems/butterfly/test/test_butterfly_response.rb +0 -43
- data/vendor/gems/butterfly/test/test_butterfly_server.rb +0 -16
- data/vendor/gems/butterfly/test/test_default.rb +0 -12
- data/vendor/gems/butterfly/test/test_helper.rb +0 -6
- data/vendor/gems/dslify/History.txt +0 -4
- data/vendor/gems/dslify/Manifest.txt +0 -25
- data/vendor/gems/dslify/PostInstall.txt +0 -5
- data/vendor/gems/dslify/README.txt +0 -60
- data/vendor/gems/dslify/Rakefile +0 -56
- data/vendor/gems/dslify/config/hoe.rb +0 -73
- data/vendor/gems/dslify/config/requirements.rb +0 -15
- data/vendor/gems/dslify/dslify.gemspec +0 -40
- data/vendor/gems/dslify/lib/dslify/dslify.rb +0 -69
- data/vendor/gems/dslify/lib/dslify/version.rb +0 -10
- data/vendor/gems/dslify/lib/dslify.rb +0 -7
- data/vendor/gems/dslify/script/console +0 -10
- data/vendor/gems/dslify/script/destroy +0 -14
- data/vendor/gems/dslify/script/generate +0 -14
- data/vendor/gems/dslify/script/txt2html +0 -82
- data/vendor/gems/dslify/setup.rb +0 -1585
- data/vendor/gems/dslify/tasks/deployment.rake +0 -34
- data/vendor/gems/dslify/tasks/environment.rake +0 -7
- data/vendor/gems/dslify/tasks/website.rake +0 -17
- data/vendor/gems/dslify/test/test_dslify.rb +0 -114
- data/vendor/gems/dslify/website/index.html +0 -86
- data/vendor/gems/dslify/website/index.txt +0 -83
- data/vendor/gems/dslify/website/javascripts/rounded_corners_lite.inc.js +0 -285
- data/vendor/gems/dslify/website/stylesheets/screen.css +0 -138
- data/vendor/gems/dslify/website/template.html.erb +0 -48
- data/vendor/gems/parenting/History.txt +0 -4
- data/vendor/gems/parenting/Manifest.txt +0 -13
- data/vendor/gems/parenting/PostInstall.txt +0 -2
- data/vendor/gems/parenting/README.rdoc +0 -47
- data/vendor/gems/parenting/Rakefile +0 -28
- data/vendor/gems/parenting/lib/parenting/base.rb +0 -65
- data/vendor/gems/parenting/lib/parenting.rb +0 -10
- data/vendor/gems/parenting/parenting.gemspec +0 -39
- data/vendor/gems/parenting/script/console +0 -10
- data/vendor/gems/parenting/script/destroy +0 -14
- data/vendor/gems/parenting/script/generate +0 -14
- data/vendor/gems/parenting/test/file_to_eval.rb +0 -9
- data/vendor/gems/parenting/test/test_helper.rb +0 -5
- data/vendor/gems/parenting/test/test_parenting.rb +0 -89
- data/vendor/gems/suitcase/LICENSE +0 -20
- data/vendor/gems/suitcase/README.rdoc +0 -31
- data/vendor/gems/suitcase/Rakefile +0 -57
- data/vendor/gems/suitcase/VERSION.yml +0 -4
- data/vendor/gems/suitcase/lib/suitcase/unzipper.rb +0 -15
- data/vendor/gems/suitcase/lib/suitcase/zipper.rb +0 -119
- data/vendor/gems/suitcase/lib/suitcase.rb +0 -5
- data/vendor/gems/suitcase/suitcase.gemspec +0 -32
- data/vendor/gems/suitcase/test/suitcase_test.rb +0 -102
- data/vendor/gems/suitcase/test/test_dir/box.rb +0 -1
- data/vendor/gems/suitcase/test/test_dir/test.txt +0 -1
- 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,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
|
-
|
9
|
-
|
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/
|
34
|
+
@basedir ||= "#{Default.tmp_path}/dr_configure/chef/cookbooks/main"
|
30
35
|
end
|
31
36
|
|
32
|
-
def recipe
|
37
|
+
def recipe(file=nil, o={}, &block)
|
33
38
|
if file
|
34
|
-
|
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
|
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}
|
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
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
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
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
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
|
-
|
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
|
111
|
-
|
120
|
+
if ::File.file? file
|
121
|
+
::Suitcase::Zipper.add_content_as(open(file).read, "solo.rb", "chef")
|
112
122
|
else
|
113
|
-
if
|
114
|
-
@config_file = file
|
115
|
-
else
|
116
|
-
conf_string = if file.empty?
|
123
|
+
conf_string = if file.empty?
|
117
124
|
# default config
|
118
|
-
|
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
|
-
|
125
|
-
|
126
|
-
|
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
|
141
|
-
|
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/
|
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
|
@@ -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
|