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