auser-poolparty 1.1.7 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +3 -0
- data/README.txt +10 -7
- data/Rakefile +0 -1
- data/VERSION.yml +2 -2
- data/bin/cloud-osxcopy +1 -1
- data/bin/cloud-setup-dev +1 -1
- data/bin/cloud-spec +0 -1
- data/bin/cloud-terminate +7 -1
- data/bin/cloud-verify +30 -0
- data/examples/basic.rb +3 -6
- data/examples/fairchild.rb +17 -21
- data/examples/maize.rb +37 -0
- data/lib/poolparty/base_packages/haproxy.rb +6 -6
- data/lib/poolparty/base_packages/heartbeat.rb +1 -43
- data/lib/poolparty/base_packages/poolparty.rb +1 -3
- data/lib/poolparty/modules/cloud_dsl.rb +10 -2
- data/lib/poolparty/modules/cloud_resourcer.rb +0 -4
- data/lib/poolparty/net/init.rb +1 -1
- data/lib/poolparty/net/remote_instance.rb +0 -27
- data/lib/poolparty/net/remoter/cloud_control.rb +0 -177
- data/lib/poolparty/net/remoter/interactive.rb +5 -16
- data/lib/poolparty/net/remoter_bases/ec2/ec2.rb +1 -10
- data/lib/poolparty/plugins/apache2.rb +53 -0
- data/lib/poolparty/plugins/deploy_directory.rb +16 -14
- data/lib/poolparty/plugins/gem_package.rb +24 -0
- data/lib/poolparty/plugins/line_in_file.rb +16 -0
- data/lib/poolparty/poolparty/plugin.rb +8 -6
- data/lib/poolparty/provision/dr_configure.rb +1 -0
- data/lib/poolparty/resources.rb +42 -0
- data/lib/poolparty/resources/cron.rb +30 -1
- data/lib/poolparty/resources/directory.rb +23 -0
- data/lib/poolparty/resources/exec.rb +22 -0
- data/lib/poolparty/resources/file.rb +28 -0
- data/lib/poolparty/resources/host.rb +22 -1
- data/lib/poolparty/resources/mount.rb +24 -0
- data/lib/poolparty/resources/package.rb +29 -13
- data/lib/poolparty/resources/remote_file.rb +32 -0
- data/lib/poolparty/resources/service.rb +20 -0
- data/lib/poolparty/resources/sshkey.rb +22 -0
- data/lib/poolparty/resources/symlink.rb +30 -0
- data/lib/poolparty/resources/variable.rb +25 -0
- data/lib/poolparty/templates/php.ini.erb +1253 -0
- data/lib/poolparty/verification/verifiers/ping.rb +5 -0
- data/lib/poolparty/verification/verify.rb +2 -0
- data/spec/bin/fixtures/bin_cloud_for_test.rb +0 -6
- data/spec/poolparty/dependency_resolver/chef_resolver_spec.rb +0 -6
- data/spec/poolparty/net/remoter_bases/ec2_remote_instance_spec.rb +0 -10
- data/spec/poolparty/spec_helper.rb +0 -1
- data/tasks/spec.rake +2 -0
- data/test/poolparty/dependency_resolver/puppet_resolver_test.rb +0 -10
- data/test/poolparty/verification/verify_test.rb +3 -3
- data/vendor/chef/apache2/attributes/apache.rb +1 -1
- data/vendor/gems/parenting/Manifest.txt +2 -1
- data/vendor/gems/parenting/lib/parenting.rb +1 -1
- data/vendor/gems/parenting/parenting.gemspec +2 -2
- metadata +8 -70
- data/bin/messenger-get-current-nodes +0 -14
- data/bin/server-become-master +0 -24
- data/bin/server-build-messenger +0 -28
- data/bin/server-clean-cert-for +0 -15
- data/bin/server-provision +0 -32
- data/bin/server-start-agent +0 -15
- data/bin/server-start-client +0 -29
- data/bin/server-start-master +0 -26
- data/bin/server-start-node +0 -32
- data/bin/server-stop-client +0 -3
- data/bin/server-stop-master +0 -3
- data/bin/server-stop-node +0 -3
- data/bin/server-update-hosts +0 -49
- data/lib/poolparty/capistrano.rb +0 -54
- data/lib/poolparty/capistrano/cloud_tasks.rb +0 -10
- data/lib/poolparty/config/postlaunchmessage.txt +0 -5
- data/lib/poolparty/net/messenger.rb +0 -57
- data/lib/poolparty/plugins/rsyncmirror.rb +0 -28
- data/lib/poolparty/services/conditional.rb +0 -46
- data/lib/poolparty/spec.rb +0 -31
- data/lib/poolparty/spec/core/string.rb +0 -18
- data/lib/poolparty/spec/matchers/a_spec_extensions_base.rb +0 -26
- data/lib/poolparty/spec/matchers/have_cron.rb +0 -28
- data/lib/poolparty/spec/matchers/have_deploydirectory.rb +0 -15
- data/lib/poolparty/spec/matchers/have_directory.rb +0 -31
- data/lib/poolparty/spec/matchers/have_exec.rb +0 -28
- data/lib/poolparty/spec/matchers/have_file.rb +0 -28
- data/lib/poolparty/spec/matchers/have_gempackage.rb +0 -28
- data/lib/poolparty/spec/matchers/have_git.rb +0 -28
- data/lib/poolparty/spec/matchers/have_host.rb +0 -28
- data/lib/poolparty/spec/matchers/have_mount.rb +0 -28
- data/lib/poolparty/spec/matchers/have_package.rb +0 -28
- data/lib/poolparty/spec/matchers/have_remotefile.rb +0 -28
- data/lib/poolparty/spec/matchers/have_rsyncmirror.rb +0 -28
- data/lib/poolparty/spec/matchers/have_service.rb +0 -28
- data/lib/poolparty/spec/matchers/have_sshkey.rb +0 -28
- data/lib/poolparty/spec/matchers/have_symlink.rb +0 -28
- data/lib/poolparty/spec/matchers/have_variable.rb +0 -32
- data/lib/poolparty/spec/spec/dynamic_matchers.rb +0 -63
- data/lib/poolparty/spec/spec/ensure_matchers_exist.rb +0 -7
- data/lib/poolparty/spec/templates/have_base.rb +0 -28
- data/spec/poolparty/net/messenger_spec.rb +0 -16
- data/spec/poolparty/services/conditional_spec.rb +0 -52
- data/spec/poolparty/spec/core/string_spec.rb +0 -57
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module Spec
|
|
2
|
-
module Matchers
|
|
3
|
-
module SpecExtensions
|
|
4
|
-
class HaveSymlink < SpecExtensionsBase
|
|
5
|
-
def initialize(expected,extra="")
|
|
6
|
-
@expected = expected
|
|
7
|
-
@extra = extra
|
|
8
|
-
end
|
|
9
|
-
def matches?(target)
|
|
10
|
-
@target = target
|
|
11
|
-
is_present?
|
|
12
|
-
end
|
|
13
|
-
def failure_message
|
|
14
|
-
"expected #{@target.inspect} to have symlink #{@expected}"
|
|
15
|
-
end
|
|
16
|
-
def negative_failure_message
|
|
17
|
-
"expected #{@target.inspect} not to have symlink #{@expected}"
|
|
18
|
-
end
|
|
19
|
-
def type
|
|
20
|
-
"symlink"
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
def have_symlink(name, extra="")
|
|
25
|
-
SpecExtensions::HaveSymlink.new(name, extra)
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module Spec
|
|
2
|
-
module Matchers
|
|
3
|
-
module SpecExtensions
|
|
4
|
-
class HaveVariable < SpecExtensionsBase
|
|
5
|
-
def initialize(varname, expected,extra="")
|
|
6
|
-
@varname = varname
|
|
7
|
-
@expected = expected
|
|
8
|
-
@extra = extra
|
|
9
|
-
end
|
|
10
|
-
def matches?(target)
|
|
11
|
-
@target = target
|
|
12
|
-
is_present?
|
|
13
|
-
end
|
|
14
|
-
def is_present?
|
|
15
|
-
@target.match(/\$#{@varname}(\W+)=(\W+)#{@expected}/)[0]
|
|
16
|
-
end
|
|
17
|
-
def failure_message
|
|
18
|
-
"expected #{@target.inspect} to have variable #{@expected}"
|
|
19
|
-
end
|
|
20
|
-
def negative_failure_message
|
|
21
|
-
"expected #{@target.inspect} not to have variable #{@expected}"
|
|
22
|
-
end
|
|
23
|
-
def type
|
|
24
|
-
"variable"
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
def have_variable(name, extra="")
|
|
29
|
-
SpecExtensions::HaveVariable.new(name, extra)
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
require "rubygems"
|
|
2
|
-
require "spec"
|
|
3
|
-
require "#{::File.dirname(__FILE__)}/../matchers/a_spec_extensions_base.rb"
|
|
4
|
-
class Object
|
|
5
|
-
# For all of the available_resources, write the matcher template
|
|
6
|
-
# based on the have_base base and write the method have_
|
|
7
|
-
# for each of the resources available
|
|
8
|
-
def write_dynamic_matchers
|
|
9
|
-
PoolParty::Resources::Resource.available_resources.each do |ty|
|
|
10
|
-
ty.downcase!
|
|
11
|
-
filename = "#{::File.dirname(__FILE__)}/../matchers/have_#{ty}.rb"
|
|
12
|
-
unless ::File.file?(filename)
|
|
13
|
-
str = make_dynamic_matcher_string_for(ty)
|
|
14
|
-
::File.open(filename, "w+") {|f| f << str}
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
# Create a dynamic matcher
|
|
19
|
-
# Create a matcher for spec based in the context called from
|
|
20
|
-
# Usage example:
|
|
21
|
-
# dynamic_matcher_for(:virtualhost) do
|
|
22
|
-
# set_description "should have virtualhost"
|
|
23
|
-
# it "should have the directory /var/www" do
|
|
24
|
-
# have_directory("/var/www")
|
|
25
|
-
# end
|
|
26
|
-
# end
|
|
27
|
-
# This creates a method by the name of the dynamic matcher
|
|
28
|
-
# so in the above example for virtualhost, the
|
|
29
|
-
# method have_virtualhost(name) &block is created in the spec
|
|
30
|
-
# context and can be called from within the describe/context
|
|
31
|
-
# in a spec
|
|
32
|
-
def dynamic_matcher_for(ty, &block)
|
|
33
|
-
name = "#{ty}".camelcase
|
|
34
|
-
|
|
35
|
-
begin
|
|
36
|
-
const = Object.const_set(name, Spec::Example::SharedExampleGroup.register(name.to_sym, &block))
|
|
37
|
-
rescue NameError => e
|
|
38
|
-
raise NameError.new(e.message + "\nThe first argument to share_as must be a legal name for a constant\n")
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
described_type = "#{ty.to_s.underscore.downcase}"
|
|
42
|
-
|
|
43
|
-
::Spec::Example::ExampleGroupMethods.module_eval <<-EOM
|
|
44
|
-
def have_#{ty.to_s.underscore.downcase}(*args)
|
|
45
|
-
include #{const}
|
|
46
|
-
self.module_eval "@@described_type = args;def #{described_type}; @@described_type; end"
|
|
47
|
-
end
|
|
48
|
-
EOM
|
|
49
|
-
end
|
|
50
|
-
# Load the have_base file and fill in the variables for the
|
|
51
|
-
# have_base base template
|
|
52
|
-
def make_dynamic_matcher_string_for(ty, matcher="is_present?")
|
|
53
|
-
@basestr ||= open("#{::File.dirname(__FILE__)}/../templates/have_base.rb").read
|
|
54
|
-
typestring = ty.to_s
|
|
55
|
-
begin
|
|
56
|
-
@basestr ^ {:classname => "Have#{typestring.capitalize}",
|
|
57
|
-
:type => typestring,
|
|
58
|
-
:matches => matcher,
|
|
59
|
-
:includer => "SpecExtensions::Have#{typestring.capitalize}.new(name, extra)"}
|
|
60
|
-
rescue Exception => e
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module Spec
|
|
2
|
-
module Matchers
|
|
3
|
-
module SpecExtensions
|
|
4
|
-
class :classname < SpecExtensionsBase
|
|
5
|
-
def initialize(expected,extra="")
|
|
6
|
-
@expected = expected
|
|
7
|
-
@extra = extra
|
|
8
|
-
end
|
|
9
|
-
def matches?(target)
|
|
10
|
-
@target = target
|
|
11
|
-
:matches
|
|
12
|
-
end
|
|
13
|
-
def failure_message
|
|
14
|
-
"expected #{@target.inspect} to have :type #{@expected}"
|
|
15
|
-
end
|
|
16
|
-
def negative_failure_message
|
|
17
|
-
"expected #{@target.inspect} not to have :type #{@expected}"
|
|
18
|
-
end
|
|
19
|
-
def type
|
|
20
|
-
":type"
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
def have_:type(name, extra="")
|
|
25
|
-
:includer
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
-
|
|
3
|
-
setup_cl
|
|
4
|
-
|
|
5
|
-
include PoolParty::Messenger
|
|
6
|
-
|
|
7
|
-
Object.send :undef_method, :messenger_send!
|
|
8
|
-
|
|
9
|
-
describe "Messenger" do
|
|
10
|
-
it "should have the method messenger_send!" do
|
|
11
|
-
Messenger.respond_to?(:messenger_send!).should == true
|
|
12
|
-
end
|
|
13
|
-
it "should call send_cmd on the client" do
|
|
14
|
-
hide_output {Messenger.messenger_send!('send_cmd ["echo hi"]', true).should =~ /-run pm_client send_cmd/}
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
-
|
|
3
|
-
# STUB!
|
|
4
|
-
def add_service(arg)
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
describe "Conditional" do
|
|
8
|
-
it "not fail when calling case_of" do
|
|
9
|
-
lambda {
|
|
10
|
-
case_of "b" do
|
|
11
|
-
end
|
|
12
|
-
}.should_not raise_error
|
|
13
|
-
end
|
|
14
|
-
it "should put the case object on the case stack as a Conditional object" do
|
|
15
|
-
c = case_of "b" do
|
|
16
|
-
end
|
|
17
|
-
c.attribute.should == "b"
|
|
18
|
-
end
|
|
19
|
-
it "should populate the when_statements when a when_is is called" do
|
|
20
|
-
c = case_of "b" do
|
|
21
|
-
when_is "b" do
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
c.when_statements.size.should == 1
|
|
25
|
-
end
|
|
26
|
-
it "freeze the case statement when calling end_of" do
|
|
27
|
-
c = case_of "b" do
|
|
28
|
-
when_is "b" do
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
c.options.frozen?.should == true
|
|
32
|
-
end
|
|
33
|
-
it "create a new service for the when_is block" do
|
|
34
|
-
c = case_of "b" do
|
|
35
|
-
when_is "b" do
|
|
36
|
-
"I'm TOTALLY B!"
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
c.when_statements[:b].is_a?(Service).should == true
|
|
40
|
-
end
|
|
41
|
-
it "create a new service for the when_is block" do
|
|
42
|
-
c = case_of "b" do
|
|
43
|
-
when_is "b" do
|
|
44
|
-
"I'm TOTALLY B!"
|
|
45
|
-
end
|
|
46
|
-
when_is "c" do
|
|
47
|
-
"You are not 'c', don't lie!"
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
c.when_statements[:b].is_a?(Service).should == true
|
|
51
|
-
end
|
|
52
|
-
end
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
|
2
|
-
require File.dirname(__FILE__) + '/../../../../lib/poolparty/spec/core/string'
|
|
3
|
-
|
|
4
|
-
describe "Spec strings" do
|
|
5
|
-
before(:each) do
|
|
6
|
-
@str=<<-EOE
|
|
7
|
-
exec { "install_passenger_script":
|
|
8
|
-
unless => 'test -f /etc/apache2/conf.d/passenger.conf',
|
|
9
|
-
path => '/usr/bin:/bin:/usr/local/bin:$PATH',
|
|
10
|
-
command => '/usr/bin/ruby /var/poolparty/install_passenger.rb'
|
|
11
|
-
}
|
|
12
|
-
service { "apache2":
|
|
13
|
-
require => Package['apache2'],
|
|
14
|
-
name => 'apache2',
|
|
15
|
-
ensure => 'running'
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
exec { "force-reload-apache2":
|
|
19
|
-
path => '/usr/bin:/bin:/usr/local/bin:$PATH',
|
|
20
|
-
command => '/etc/init.d/apache2 force-reload',
|
|
21
|
-
refreshonly => 'true'
|
|
22
|
-
}
|
|
23
|
-
EOE
|
|
24
|
-
end
|
|
25
|
-
it "should have the method grab_entry_for" do
|
|
26
|
-
"hi".respond_to?(:grab_entry_for).should == true
|
|
27
|
-
end
|
|
28
|
-
describe "grab_entry_for" do
|
|
29
|
-
it "should be able to grab the entry for the apache2 service" do
|
|
30
|
-
@str.grab_entry_for(:service, "apache2").gsub(/[\n\t ]+/, '').should == "service{\"apache2\":require=>Package['apache2'],name=>'apache2',ensure=>'running'}"
|
|
31
|
-
end
|
|
32
|
-
it "should be able to grab the entry for the install_passenger_script exec" do
|
|
33
|
-
@str.grab_entry_for(:exec, "install_passenger_script").gsub(/[\n\t ]+/, '').should == "exec{\"install_passenger_script\":unless=>'test-f/etc/apache2/conf.d/passenger.conf',path=>'/usr/bin:/bin:/usr/local/bin:$PATH',command=>'/usr/bin/ruby/var/poolparty/install_passenger.rb'}"
|
|
34
|
-
end
|
|
35
|
-
it "should return an empty string if there is no entry" do
|
|
36
|
-
@str.grab_entry_for(:pocket, "rangers").should == ""
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
describe "grab_key_value_for" do
|
|
40
|
-
it "should be able to say the service apache2 is set to ensure running" do
|
|
41
|
-
@str.grab_key_value_for(:service, "apache2", :ensure).should == "'running'"
|
|
42
|
-
end
|
|
43
|
-
it "should be able to say the exec force-reload-apache2 has the command '/etc/init.d/apache2 force-reload'" do
|
|
44
|
-
@str.grab_key_value_for(:exec, "force-reload-apache2", :command).should == "'/etc/init.d/apache2 force-reload'"
|
|
45
|
-
end
|
|
46
|
-
it "should be able to grab them with strings with quotes" do
|
|
47
|
-
"exec { \"a2enmod ssl\":
|
|
48
|
-
command => 'a2enmod ssl',
|
|
49
|
-
require => [ Package['apache2-common'], Package['openssl'] ],
|
|
50
|
-
path => '/usr/bin:/bin:/usr/local/bin:$PATH',
|
|
51
|
-
unless => '/usr/bin/test -L /etc/apache2/mods-enabled/ssl.load',
|
|
52
|
-
notify => Exec['restart-apache2']
|
|
53
|
-
}
|
|
54
|
-
".grab_key_value_for(:exec, "a2enmod ssl", :notify).should == "Exec['restart-apache2']"
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|