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
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
APPNAME=eunit
|
3
|
+
|
4
|
+
SUB_DIRECTORIES = src
|
5
|
+
|
6
|
+
include vsn.mk
|
7
|
+
|
8
|
+
DOC_OPTS={def,{version,\"$(EUNIT_VSN)\"}}
|
9
|
+
|
10
|
+
|
11
|
+
all: subdirs
|
12
|
+
|
13
|
+
subdirs:
|
14
|
+
@for d in $(SUB_DIRECTORIES); do \
|
15
|
+
(cd $$d; $(MAKE)); \
|
16
|
+
done
|
17
|
+
|
18
|
+
clean:
|
19
|
+
@for d in $(SUB_DIRECTORIES); do \
|
20
|
+
(cd $$d; $(MAKE) clean); \
|
21
|
+
done
|
22
|
+
|
23
|
+
docs:
|
24
|
+
erl -noshell -eval "edoc:application($(APPNAME), \".\", [$(DOC_OPTS)])" -s init stop
|
25
|
+
|
26
|
+
test: subdirs
|
27
|
+
@echo Testing...
|
28
|
+
@erl -noshell -pa ebin -s eunit test -s init stop
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,46 @@
|
|
1
|
+
|
2
|
+
include ../vsn.mk
|
3
|
+
|
4
|
+
EMULATOR=beam
|
5
|
+
EBIN=../ebin
|
6
|
+
INCLUDE=../include
|
7
|
+
|
8
|
+
APP_TARGET=$(EBIN)/eunit.app
|
9
|
+
APPUP_TARGET=$(EBIN)/eunit.appup
|
10
|
+
|
11
|
+
ERL_COMPILE_FLAGS += -I$(INCLUDE) +warn_unused_vars +nowarn_shadow_vars +warn_unused_import
|
12
|
+
|
13
|
+
SOURCES= \
|
14
|
+
eunit_autoexport.erl \
|
15
|
+
eunit_striptests.erl \
|
16
|
+
eunit.erl \
|
17
|
+
eunit_tests.erl \
|
18
|
+
eunit_server.erl \
|
19
|
+
eunit_proc.erl \
|
20
|
+
eunit_serial.erl \
|
21
|
+
eunit_test.erl \
|
22
|
+
eunit_lib.erl \
|
23
|
+
eunit_data.erl \
|
24
|
+
eunit_tty.erl \
|
25
|
+
code_monitor.erl \
|
26
|
+
file_monitor.erl \
|
27
|
+
autoload.erl
|
28
|
+
|
29
|
+
OBJECTS=$(SOURCES:%.erl=$(EBIN)/%.$(EMULATOR)) $(APP_TARGET) $(APPUP_TARGET)
|
30
|
+
|
31
|
+
all: $(OBJECTS)
|
32
|
+
|
33
|
+
$(OBJECTS): eunit_internal.hrl \
|
34
|
+
$(INCLUDE)/eunit.hrl
|
35
|
+
|
36
|
+
clean:
|
37
|
+
rm -f $(OBJECTS)
|
38
|
+
|
39
|
+
$(EBIN)/%.$(EMULATOR):%.erl
|
40
|
+
erlc -pa $(EBIN) -W $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
|
41
|
+
|
42
|
+
$(APP_TARGET): eunit.app.src ../vsn.mk
|
43
|
+
sed -e 's;%VSN%;$(EUNIT_VSN);' $< > $@
|
44
|
+
|
45
|
+
$(APPUP_TARGET): eunit.appup.src ../vsn.mk
|
46
|
+
sed -e 's;%VSN%;$(EUNIT_VSN);' $< > $@
|
@@ -105,6 +105,11 @@ handle_call({get_current_load, Types}, _From, State) ->
|
|
105
105
|
LoadForType = [utils:average_of_list(get_load_for_type(Type, State)) || Type <- Types],
|
106
106
|
?TRACE("LoadForType: ",[LoadForType]),
|
107
107
|
{reply, LoadForType, State};
|
108
|
+
% Handle puppet needs
|
109
|
+
handle_call({clear_cert_for, Name}, _From, State) ->
|
110
|
+
String = string:concat(". /etc/profile && /usr/bin/puppetcleaner ",Name),
|
111
|
+
os:cmd(String),
|
112
|
+
{reply, ok, State};
|
108
113
|
handle_call({get_current_nodes, _Args}, _From, State) ->
|
109
114
|
{reply, get_live_nodes(State), State}.
|
110
115
|
|
@@ -133,7 +133,7 @@ init(Args) ->
|
|
133
133
|
%% Description: Handling call messages
|
134
134
|
%%--------------------------------------------------------------------
|
135
135
|
handle_call({run_command, Cmd}, _From, State) ->
|
136
|
-
Reply = os:cmd(
|
136
|
+
Reply = os:cmd(Cmd),
|
137
137
|
{reply, Reply, State};
|
138
138
|
handle_call({update_load, Type, Load}, _From, State) ->
|
139
139
|
{Type, NewState} = store_load_for_type(Type, Load, State),
|
@@ -197,5 +197,4 @@ code_change(_OldVsn, State, _Extra) ->
|
|
197
197
|
{ok, State}.
|
198
198
|
|
199
199
|
% Private
|
200
|
-
server_location() ->
|
201
|
-
global:whereis_name(node()).
|
200
|
+
server_location() -> global:whereis_name(node()).
|
@@ -0,0 +1,213 @@
|
|
1
|
+
%
|
2
|
+
% pm_spawner.erl
|
3
|
+
% Spawn a process in this gen_server remotely
|
4
|
+
% and hear back from it when it's got stuff to say
|
5
|
+
%
|
6
|
+
% Created by Ari Lerner on 2008-12-05.
|
7
|
+
% Copyright 2008 CitrusByte. All rights reserved.
|
8
|
+
%
|
9
|
+
-module (pm_spawner).
|
10
|
+
-behaviour(gen_server).
|
11
|
+
|
12
|
+
-include_lib("../include/defines.hrl").
|
13
|
+
|
14
|
+
%% API
|
15
|
+
-export([start_link/0]).
|
16
|
+
-export ([run_command/1, run_command/2, check_command/1]).
|
17
|
+
|
18
|
+
%% gen_server callbacks
|
19
|
+
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
|
20
|
+
|
21
|
+
-record(state, {
|
22
|
+
processes = ?DICT:new() % Array of the output
|
23
|
+
}).
|
24
|
+
-define(SERVER, ?MODULE).
|
25
|
+
|
26
|
+
%%--------------------------------------------------------------------
|
27
|
+
%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}
|
28
|
+
%% Description: Starts the server
|
29
|
+
%%--------------------------------------------------------------------
|
30
|
+
start_link() -> gen_server:start_link({global, ?MODULE}, ?MODULE, [], []).
|
31
|
+
|
32
|
+
%%====================================================================
|
33
|
+
%% gen_server callbacks
|
34
|
+
%%====================================================================
|
35
|
+
|
36
|
+
%%--------------------------------------------------------------------
|
37
|
+
%% Function: init(Args) -> {ok, State} |
|
38
|
+
%% {ok, State, Timeout} |
|
39
|
+
%% ignore |
|
40
|
+
%% {stop, Reason}
|
41
|
+
%% Description: Initiates the server
|
42
|
+
%%--------------------------------------------------------------------
|
43
|
+
init([]) ->
|
44
|
+
% process_flag(trap_exit, true),
|
45
|
+
{ok, #state{
|
46
|
+
processes = ?DICT:new()
|
47
|
+
}}.
|
48
|
+
|
49
|
+
%%--------------------------------------------------------------------
|
50
|
+
%% Function: %% handle_call(Request, From, State) -> {reply, Reply, State} |
|
51
|
+
%% {reply, Reply, State, Timeout} |
|
52
|
+
%% {noreply, State} |
|
53
|
+
%% {noreply, State, Timeout} |
|
54
|
+
%% {stop, Reason, Reply, State} |
|
55
|
+
%% {stop, Reason, State}
|
56
|
+
%% Description: Handling call messages
|
57
|
+
%%--------------------------------------------------------------------
|
58
|
+
handle_call({run_command, Cmds}, _From, State) ->
|
59
|
+
{ok, NewState} = run_command(Cmds, State),
|
60
|
+
?TRACE("storing into state from call", [Cmds, NewState]),
|
61
|
+
{reply, ok, NewState};
|
62
|
+
handle_call({check_command, Cmd}, _From, State) ->
|
63
|
+
AtomCommand = erlang:list_to_atom(Cmd),
|
64
|
+
?TRACE("is_key for ", [AtomCommand, ?DICT:is_key(AtomCommand, State#state.processes)]),
|
65
|
+
case ?DICT:is_key(AtomCommand, State#state.processes) of
|
66
|
+
false ->
|
67
|
+
Reply = nil,
|
68
|
+
NewState = State;
|
69
|
+
true ->
|
70
|
+
Pid = ?DICT:fetch(AtomCommand, State#state.processes),
|
71
|
+
case erlang:is_pid(Pid) of
|
72
|
+
true ->
|
73
|
+
Pid ! {self(), collect},
|
74
|
+
receive
|
75
|
+
{command_response, OutFromCommand} ->
|
76
|
+
Reply = OutFromCommand,
|
77
|
+
NewState = State#state{processes = ?DICT:store(AtomCommand, OutFromCommand, State#state.processes)};
|
78
|
+
Msg ->
|
79
|
+
NewState = State,
|
80
|
+
Reply = Msg
|
81
|
+
after
|
82
|
+
1000 ->
|
83
|
+
Pid ! {self(), collect},
|
84
|
+
NewState = State,
|
85
|
+
Reply = "no output"
|
86
|
+
end;
|
87
|
+
false ->
|
88
|
+
NewState = State,
|
89
|
+
Reply = Pid
|
90
|
+
end
|
91
|
+
end,
|
92
|
+
{reply, Reply, NewState};
|
93
|
+
handle_call(_Request, _From, State) ->
|
94
|
+
Reply = ok,
|
95
|
+
{reply, Reply, State}.
|
96
|
+
%%--------------------------------------------------------------------
|
97
|
+
%% Function: handle_cast(Msg, State) -> {noreply, State} |
|
98
|
+
%% {noreply, State, Timeout} |
|
99
|
+
%% {stop, Reason, State}
|
100
|
+
%% Description: Handling cast messages
|
101
|
+
%%--------------------------------------------------------------------
|
102
|
+
handle_cast({run_command, Cmd}, State) ->
|
103
|
+
{ok, NewState} = run_command(Cmd, State),
|
104
|
+
{noreply, NewState};
|
105
|
+
handle_cast(_Msg, State) ->
|
106
|
+
{noreply, State}.
|
107
|
+
|
108
|
+
%%--------------------------------------------------------------------
|
109
|
+
%% Function: handle_info(Info, State) -> {noreply, State} |
|
110
|
+
%% {noreply, State, Timeout} |
|
111
|
+
%% {stop, Reason, State}
|
112
|
+
%% Description: Handling all non call/cast messages
|
113
|
+
%%--------------------------------------------------------------------
|
114
|
+
handle_info(_Info, State) ->
|
115
|
+
{noreply, State}.
|
116
|
+
|
117
|
+
%%--------------------------------------------------------------------
|
118
|
+
%% Function: terminate(Reason, State) -> void()
|
119
|
+
%% Description: This function is called by a gen_server when it is about to
|
120
|
+
%% terminate. It should be the opposite of Module:init/1 and do any necessary
|
121
|
+
%% cleaning up. When it returns, the gen_server terminates with Reason.
|
122
|
+
%% The return value is ignored.
|
123
|
+
%%--------------------------------------------------------------------
|
124
|
+
terminate(_Reason, _State) ->
|
125
|
+
ok.
|
126
|
+
|
127
|
+
%%--------------------------------------------------------------------
|
128
|
+
%% Func: code_change(OldVsn, State, Extra) -> {ok, NewState}
|
129
|
+
%% Description: Convert process state when code is changed
|
130
|
+
%%--------------------------------------------------------------------
|
131
|
+
code_change(_OldVsn, State, _Extra) ->
|
132
|
+
{ok, State}.
|
133
|
+
|
134
|
+
% Quick helper for running commands
|
135
|
+
run_command(Cmd) -> gen_server:call(server_location(), {run_command, Cmd}).
|
136
|
+
check_command(Cmd) ->
|
137
|
+
Command = lists:flatten(io_lib:format("~s", [Cmd])),
|
138
|
+
gen_server:call(server_location(), {check_command, Command}).
|
139
|
+
|
140
|
+
% Run the command, start up the
|
141
|
+
run_command(Cmd, State) ->
|
142
|
+
Command = lists:flatten(io_lib:format("~s", [Cmd])),
|
143
|
+
AtomCommand = erlang:list_to_atom(Command),
|
144
|
+
Pid = spawn(fun() -> spawn_command(Command) end),
|
145
|
+
Storage = Pid,
|
146
|
+
?TRACE("storing into state", [AtomCommand]),
|
147
|
+
NewState = State#state{processes = ?DICT:store(AtomCommand, Storage, State#state.processes)},
|
148
|
+
{ok, NewState}.
|
149
|
+
|
150
|
+
spawn_command(Command) ->
|
151
|
+
Port = erlang:open_port({spawn, Command}, [stream, exit_status, stderr_to_stdout, use_stdio]),
|
152
|
+
ResponsePid = response_reader(Port),
|
153
|
+
spawn_command_loop(Command, Port, ResponsePid).
|
154
|
+
|
155
|
+
spawn_command_loop(Command, Port, Responses) ->
|
156
|
+
receive
|
157
|
+
{Pid, collect} ->
|
158
|
+
case erlang:is_pid(Responses) of
|
159
|
+
true ->
|
160
|
+
io:format("There is no output on your command yet, try again in a few seconds ~p~n", [Responses]),
|
161
|
+
spawn_command_loop(Command, Port, Responses);
|
162
|
+
false ->
|
163
|
+
Pid ! {command_response, Responses}
|
164
|
+
end;
|
165
|
+
{exit_status, _} ->
|
166
|
+
spawn_command_loop(Command, Port, Responses);
|
167
|
+
{done, Port, Response} ->
|
168
|
+
?TRACE("Received done message", Response),
|
169
|
+
spawn_command_loop(Command, Port, Response);
|
170
|
+
{Port, {exit_status, 0}} ->
|
171
|
+
?TRACE("Received exit_status", [Port]),
|
172
|
+
Responses ! {Port, {exit_status, 0, self()}},
|
173
|
+
receive
|
174
|
+
{ok, Resp} ->
|
175
|
+
?TRACE("Received ok back", [Resp]),
|
176
|
+
spawn_command_loop(Command, Port, Resp)
|
177
|
+
end;
|
178
|
+
Mes ->
|
179
|
+
?TRACE("received message", [Mes]),
|
180
|
+
Responses ! Mes,
|
181
|
+
spawn_command_loop(Command, Port, Responses)
|
182
|
+
end.
|
183
|
+
|
184
|
+
response_reader(Port) ->
|
185
|
+
ResponsePid = spawn(fun() -> response_reader_loop(Port, []) end),
|
186
|
+
ResponsePid.
|
187
|
+
|
188
|
+
response_reader_loop(Port, Acc) ->
|
189
|
+
receive
|
190
|
+
{Port, {data, Bin}} ->
|
191
|
+
?TRACE("received data", [Bin]),
|
192
|
+
response_reader_loop(Port, [Bin|Acc]);
|
193
|
+
{Port, {exit_status, 0, Pid}} ->
|
194
|
+
catch erlang:port_close(Port),
|
195
|
+
Response = lists:flatten(lists:reverse(Acc)),
|
196
|
+
?TRACE("received exit_status", [Response, Port]),
|
197
|
+
Pid ! {ok, Response};
|
198
|
+
{Port, {exit_status, _}} ->
|
199
|
+
catch erlang:port_close(Port),
|
200
|
+
Output = lists:flatten(lists:reverse(Acc)),
|
201
|
+
{error, Output};
|
202
|
+
{Pid, get_data} ->
|
203
|
+
?TRACE("get_data for", [Pid, Acc]),
|
204
|
+
Pid ! {data, Port, Acc},
|
205
|
+
response_reader_loop(Port, Acc);
|
206
|
+
{_, collect} ->
|
207
|
+
response_reader_loop(Port, Acc);
|
208
|
+
Mes ->
|
209
|
+
io:format("Unexpected message in response_reader_loop ~p~n", [Mes]),
|
210
|
+
response_reader_loop(Port, Acc)
|
211
|
+
end.
|
212
|
+
|
213
|
+
server_location() -> global:whereis_name(?SERVER).
|
@@ -2,57 +2,71 @@ module PoolParty
|
|
2
2
|
class Base
|
3
3
|
plugin :heartbeat do
|
4
4
|
|
5
|
-
# TODO: Reimplement heartbeat
|
6
5
|
def enable
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
6
|
+
# execute_on_master do
|
7
|
+
has_package(:name => "heartbeat") do
|
8
|
+
has_service(:name => "heartbeat", :hasstatus => true, :hasrestart => true)
|
9
|
+
has_directory(:name => "/etc/ha.d")
|
10
|
+
|
11
|
+
has_remotefile(:name => "/etc/ha.d/ha.cf") do
|
12
|
+
mode 444
|
13
|
+
notify service(:name => "heartbeat")
|
14
|
+
template File.join(File.dirname(__FILE__), "..", "templates/ha.cf")
|
15
|
+
end
|
16
|
+
|
17
|
+
has_remotefile(:name => "/etc/ha.d/logd.cf") do
|
18
|
+
mode 600
|
19
|
+
notify service(:name => "heartbeat")
|
20
|
+
template File.join(File.dirname(__FILE__), "..", "templates/logd.cf")
|
21
|
+
end
|
22
|
+
|
23
|
+
has_exec(:name => "heartbeat-update-cib", :command => "/usr/sbin/cibadmin -R -x /etc/ha.d/cib.xml", :refreshonly => true)
|
24
|
+
|
25
|
+
has_remotefile(:name => "/etc/ha.d/authkeys") do
|
26
|
+
mode 600
|
27
|
+
notify service(:name => "heartbeat")
|
28
|
+
template File.join(File.dirname(__FILE__), "..", "templates/authkeys")
|
29
|
+
end
|
30
|
+
|
31
|
+
has_remotefile(:name => "/etc/ha.d/cib.xml") do
|
32
|
+
mode 444
|
33
|
+
notify exec(:name => "heartbeat-update-cib")
|
34
|
+
template File.join(File.dirname(__FILE__), "..", "templates/cib.xml")
|
35
|
+
end
|
36
|
+
|
37
|
+
has_remotefile(:name => "/etc/ha.d/haresources") do
|
38
|
+
mode 644
|
39
|
+
template File.join(File.dirname(__FILE__), "..", "templates/haresources")
|
40
|
+
end
|
41
|
+
# end
|
42
|
+
|
43
|
+
# variables for the templates
|
44
|
+
has_variable(:name => "ha_nodenames", :value => "generate('/usr/bin/env', '/usr/bin/server-list-active', '-c', 'name', '-n', '#{cloud.name}')")
|
45
|
+
has_variable(:name => "ha_node_ips", :value => "generate('/usr/bin/env', '/usr/bin/server-list-active', '-c', 'ip', '-n', '#{cloud.name}')")
|
46
|
+
|
47
|
+
has_variable({:name => "ha_timeout", :value => (self.respond_to?(:timeout) ? timeout : "5s")})
|
48
|
+
has_variable({:name => "ha_port", :value => (self.respond_to?(:port) ? port : Base.port)})
|
49
|
+
|
50
|
+
# Finally, let's set a few options and start it
|
51
|
+
# has_exec(:name => "set and start") do
|
52
|
+
# refreshonly true
|
53
|
+
# command <<-EOC
|
54
|
+
# crm_mon -i5
|
55
|
+
# EOC
|
56
|
+
# end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
# execute_on_master do
|
48
61
|
# if list_of_node_names.size > 1
|
49
62
|
# has_exec(:name => "update pem for heartbeat", :refreshonly => true) do
|
50
|
-
# command "scp /etc/puppet/ssl/ca/ca_crl.pem #{user || Base.user}@#{list_of_node_ips[1]}
|
63
|
+
# command "scp /etc/puppet/ssl/ca/ca_crl.pem #{user || Base.user}@#{list_of_node_ips[1]}:#{Base.base_config_directory}/ssl/ca"
|
51
64
|
# end
|
52
65
|
# end
|
53
66
|
# end
|
54
67
|
|
55
68
|
end
|
69
|
+
|
56
70
|
end
|
57
71
|
end
|
58
72
|
end
|
@@ -49,12 +49,12 @@ module PoolParty
|
|
49
49
|
template File.join(File.dirname(__FILE__), "..", "templates/puppetrunner")
|
50
50
|
end
|
51
51
|
|
52
|
-
execute_on_node do
|
53
|
-
has_cron(:name => "node puppetd runner", :user => Base.user, :minute => "*/
|
52
|
+
# execute_on_node do
|
53
|
+
has_cron(:name => "node puppetd runner", :user => Base.user, :minute => "*/15") do
|
54
54
|
requires get_gempackage("poolparty")
|
55
55
|
command "/usr/bin/puppetrunner"
|
56
56
|
end
|
57
|
-
end
|
57
|
+
# end
|
58
58
|
|
59
59
|
# end
|
60
60
|
|
@@ -68,13 +68,23 @@ module PoolParty
|
|
68
68
|
|
69
69
|
# Custom run puppet to minimize footprint
|
70
70
|
# TODO: Update the offsetted times
|
71
|
+
has_remotefile(:name => "/usr/bin/puppetrerun") do
|
72
|
+
mode 744
|
73
|
+
template File.join(File.dirname(__FILE__), "..", "templates/puppetrerun")
|
74
|
+
end
|
75
|
+
|
76
|
+
has_remotefile(:name => "/usr/bin/puppetcleaner") do
|
77
|
+
mode 744
|
78
|
+
template File.join(File.dirname(__FILE__), "..", "templates/puppetcleaner")
|
79
|
+
end
|
80
|
+
|
71
81
|
execute_on_master do
|
72
82
|
has_exec(:name => "update_hosts", :command => ". /etc/profile && server-update-hosts -n #{cloud.name}")
|
73
83
|
|
74
|
-
has_cron(:name => "master puppetd runner", :user => Base.user, :minute => "*/15") do
|
75
|
-
|
76
|
-
|
77
|
-
end
|
84
|
+
# has_cron(:name => "master puppetd runner", :user => Base.user, :minute => "*/15") do
|
85
|
+
# requires get_gempackage("poolparty")
|
86
|
+
# command(PoolParty::Remote::RemoteInstance.puppet_runner_command)
|
87
|
+
# end
|
78
88
|
has_cron(:name => "Load handler", :user => Base.user, :minute => "*/4") do
|
79
89
|
requires get_gempackage("poolparty")
|
80
90
|
command(". /etc/profile && cloud-handle-load -n #{cloud.name}")
|
@@ -93,15 +103,8 @@ module PoolParty
|
|
93
103
|
|
94
104
|
has_cron({:name => "maintain script", :command => ". /etc/profile && cloud-maintain -n #{cloud.name}", :minute => "*/3", :requires => [get_gempackage("poolparty"), get_cron("puppetd runner"), get_cron("Load handler"), get_service("haproxy")]})
|
95
105
|
|
96
|
-
|
97
|
-
mode 744
|
98
|
-
template File.join(File.dirname(__FILE__), "..", "templates/puppetcleaner")
|
99
|
-
end
|
106
|
+
has_cron(:name => "ensure puppetmaster is running", :command => ". /etc/profile && puppetmasterd --verbose", :hour => "0")
|
100
107
|
|
101
|
-
has_remotefile(:name => "/usr/bin/puppetrerun") do
|
102
|
-
mode 744
|
103
|
-
template File.join(File.dirname(__FILE__), "..", "templates/puppetrerun")
|
104
|
-
end
|
105
108
|
end
|
106
109
|
# has_host(:name => "puppet", :ip => (self.respond_to?(:master) ? self : parent).master.ip)
|
107
110
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module PoolParty
|
2
|
+
module Capistrano
|
3
|
+
|
4
|
+
def set_cloud(cld=nil)
|
5
|
+
raise unless cld
|
6
|
+
@cloud = cld
|
7
|
+
end
|
8
|
+
|
9
|
+
def set_poolparty_roles
|
10
|
+
returning Array.new do |arr|
|
11
|
+
arr << "role 'master.#{@cloud.name}'.to_sym, '#{@cloud.master.ip}'"
|
12
|
+
arr << "role :master, '#{@cloud.master.ip}'"
|
13
|
+
arr << "role :slaves, '#{@cloud.nonmaster_nonterminated_instances.map{|a| a.ip}.join('", "')}'" if @cloud.nonmaster_nonterminated_instances.size > 0
|
14
|
+
end.join("\n")
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/lib/poolparty/core/class.rb
CHANGED
@@ -1,2 +1,26 @@
|
|
1
|
+
# Taken from rspec with high respect.
|
2
|
+
# Mainly unused, for now
|
1
3
|
class Class
|
4
|
+
# Creates a new subclass of self, with a name "under" our own name.
|
5
|
+
# Example:
|
6
|
+
#
|
7
|
+
# x = Foo::Bar.subclass('Zap'){}
|
8
|
+
# x.name # => Foo::Bar::Zap_1
|
9
|
+
# x.superclass.name # => Foo::Bar
|
10
|
+
def subclass(base_name, &body)
|
11
|
+
klass = Class.new(self)
|
12
|
+
class_name = "#{base_name}_#{class_count!}"
|
13
|
+
instance_eval do
|
14
|
+
const_set(class_name, klass)
|
15
|
+
end
|
16
|
+
klass.instance_eval(&body)
|
17
|
+
klass
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
def class_count!
|
22
|
+
@class_count ||= 0
|
23
|
+
@class_count += 1
|
24
|
+
@class_count
|
25
|
+
end
|
2
26
|
end
|
@@ -24,14 +24,21 @@ module Kernel
|
|
24
24
|
ensure
|
25
25
|
$-v = saved_verbosity
|
26
26
|
end
|
27
|
+
|
28
|
+
#redirect stdout and stderr to /dev/null and reopen after block
|
27
29
|
def hide_output
|
28
30
|
begin
|
29
31
|
old_stdout = STDOUT.dup
|
32
|
+
old_stderr = STDERR.dup
|
30
33
|
STDOUT.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
|
34
|
+
STDERR.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
|
31
35
|
yield if block_given?
|
32
36
|
ensure
|
33
37
|
STDOUT.flush
|
34
38
|
STDOUT.reopen(old_stdout)
|
39
|
+
STDERR.flush
|
40
|
+
STDERR.reopen(old_stderr)
|
35
41
|
end
|
36
42
|
end
|
43
|
+
|
37
44
|
end
|