auser-poolparty 1.2.10 → 1.2.11
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/bin/cloud +1 -1
- data/bin/cloud-list +19 -7
- data/bin/cloud-provision +3 -0
- data/bin/cloud-run +37 -0
- data/bin/server-list-active +1 -1
- data/config/jeweler.rb +2 -2
- data/examples/basic.rb +4 -3
- data/examples/fairchild.rb +2 -2
- data/examples/metavirt_cloud.rb +18 -8
- data/examples/simple.rb +4 -3
- data/examples/vmrun_cloud.rb +2 -5
- data/lib/poolparty.rb +1 -1
- data/lib/poolparty/core/object.rb +6 -4
- data/lib/poolparty/core/string.rb +2 -1
- data/lib/poolparty/helpers/optioner.rb +1 -1
- data/lib/poolparty/modules/callbacks.rb +2 -0
- data/lib/poolparty/modules/cloud_resourcer.rb +4 -5
- data/lib/poolparty/modules/daemonizable.rb +4 -5
- data/lib/poolparty/modules/definable_resource.rb +1 -0
- data/lib/poolparty/modules/pinger.rb +5 -1
- data/lib/poolparty/monitors/monitor_daemon.rb +159 -0
- data/lib/poolparty/monitors/monitor_rack.rb +21 -11
- data/lib/poolparty/monitors/monitors/clock_monitor.rb +5 -0
- data/lib/poolparty/monitors/monitors/elections_monitor.rb +49 -0
- data/lib/poolparty/monitors/monitors/neighborhood_monitor.rb +7 -7
- data/lib/poolparty/monitors/monitors/stats_monitor.rb +15 -3
- data/lib/poolparty/net/init.rb +1 -1
- data/lib/poolparty/net/remote_instance.rb +43 -39
- data/lib/poolparty/net/remoter/connections.rb +6 -3
- data/lib/poolparty/net/remoter/interactive.rb +18 -11
- data/lib/poolparty/net/remoter_base.rb +39 -12
- data/lib/poolparty/net/remoter_bases/ec2/ec2.rb +23 -19
- data/lib/poolparty/net/remoter_bases/ec2/ec2_remote_instance.rb +15 -33
- data/lib/poolparty/net/remoter_bases/ec2/ec2_response_object.rb +28 -20
- data/lib/poolparty/net/remoter_bases/libvirt/libvirt.rb +73 -0
- data/lib/poolparty/net/remoter_bases/libvirt/libvirt_instance.rb +64 -0
- data/lib/poolparty/net/remoter_bases/metavirt/metavirt.rb +27 -17
- data/lib/poolparty/net/remoter_bases/metavirt/metavirt_instance.rb +20 -35
- data/lib/poolparty/net/remoter_bases/vmrun/vmrun.rb +35 -17
- data/lib/poolparty/net/remoter_bases/vmrun/vmrun_instance.rb +32 -24
- data/lib/poolparty/plugins/apache2/apache.rb +1 -1
- data/lib/poolparty/plugins/chef/chef.rb +12 -26
- data/lib/poolparty/plugins/chef/chef_deploy.rb +5 -23
- data/lib/poolparty/plugins/chef/chef_deploy_definition.rb +32 -0
- data/lib/poolparty/plugins/chef/chef_library.rb +7 -0
- data/lib/poolparty/plugins/chef/chef_recipe.rb +7 -0
- data/lib/poolparty/plugins/chef/include_chef_recipe.rb +14 -0
- data/lib/poolparty/{resources → plugins}/host.rb +5 -4
- data/lib/poolparty/plugins/line_in_file.rb +1 -1
- data/lib/poolparty/{resources → plugins}/sshkey.rb +10 -8
- data/lib/poolparty/poolparty/cloud.rb +7 -0
- data/lib/poolparty/poolparty/default.rb +0 -2
- data/lib/poolparty/poolparty/pool.rb +13 -3
- data/lib/poolparty/provision/boot_strapper.rb +8 -8
- data/lib/poolparty/resources/exec.rb +7 -0
- data/lib/poolparty/resources/group.rb +3 -3
- data/lib/poolparty/resources/user.rb +6 -1
- data/lib/poolparty/templates/monitor.ru +12 -0
- data/spec/poolparty/net/remoter_bases/ec2_remote_instance_spec.rb +0 -2
- data/spec/poolparty/net/remoter_bases/ec2_spec.rb +7 -4
- data/spec/poolparty/poolparty/example_spec.rb +21 -21
- data/spec/poolparty/poolparty/pool_spec.rb +2 -1
- data/spec/poolparty/resources/sshkey_spec.rb +39 -40
- data/tasks/poolparty.rake +27 -1
- data/test/fixtures/fake_clouds.rb +11 -0
- data/test/poolparty/dependency_resolver/chef_resolver_test.rb +82 -0
- data/test/poolparty/monitors/test_base_monitor.rb +2 -2
- data/test/poolparty/monitors/test_monitor_rack.rb +11 -24
- data/test/poolparty/net/remoter_base_test.rb +4 -5
- data/test/poolparty/net/remoter_bases/libvirt/libvirt_test.rb +70 -0
- data/test/poolparty/net/remoter_bases/metavirt/metavirt_test.rb +32 -3
- data/test/poolparty/plugins/chef_plugin_test.rb +23 -0
- data/test/poolparty/poolparty/pool_test.rb +22 -0
- data/vendor/gems/dslify/lib/dslify.rb +3 -0
- data/vendor/gems/dslify/test/dslify_test.rb +4 -15
- data/vendor/gems/git-style-binaries/README.markdown +6 -0
- data/vendor/gems/git-style-binaries/Rakefile +1 -1
- data/vendor/gems/git-style-binaries/VERSION.yml +1 -1
- data/vendor/gems/git-style-binaries/doc/gsb-screencast.png +0 -0
- data/vendor/gems/git-style-binaries/doc/poolparty-binaries.screenplay +11 -13
- data/vendor/gems/git-style-binaries/git-style-binaries.gemspec +12 -3
- data/vendor/gems/git-style-binaries/lib/git-style-binary.rb +15 -1
- data/vendor/gems/git-style-binaries/test/running_binaries_test.rb +2 -2
- data/vendor/gems/suitcase/VERSION.yml +1 -1
- data/vendor/gems/suitcase/lib/suitcase/zipper.rb +73 -25
- data/vendor/gems/suitcase/suitcase.gemspec +5 -5
- data/vendor/gems/suitcase/test/suitcase_test.rb +12 -6
- data/vendor/gems/suitcase/test/test_dir/gems/famoseagle-carrot-0.6.0.gem +0 -0
- metadata +24 -52
- data/spec/poolparty/resources/host_spec.rb +0 -35
- data/vendor/gems/rest-client/README.rdoc +0 -151
- data/vendor/gems/rest-client/Rakefile +0 -85
- data/vendor/gems/rest-client/bin/restclient +0 -87
- data/vendor/gems/rest-client/lib/rest_client.rb +0 -2
- data/vendor/gems/rest-client/lib/restclient.rb +0 -93
- data/vendor/gems/rest-client/lib/restclient/exceptions.rb +0 -84
- data/vendor/gems/rest-client/lib/restclient/mixin/response.rb +0 -43
- data/vendor/gems/rest-client/lib/restclient/raw_response.rb +0 -30
- data/vendor/gems/rest-client/lib/restclient/request.rb +0 -232
- data/vendor/gems/rest-client/lib/restclient/resource.rb +0 -146
- data/vendor/gems/rest-client/lib/restclient/response.rb +0 -20
- data/vendor/gems/rest-client/rest-client.gemspec +0 -21
- data/vendor/gems/rest-client/spec/base.rb +0 -4
- data/vendor/gems/rest-client/spec/exceptions_spec.rb +0 -54
- data/vendor/gems/rest-client/spec/mixin/response_spec.rb +0 -46
- data/vendor/gems/rest-client/spec/raw_response_spec.rb +0 -17
- data/vendor/gems/rest-client/spec/request_spec.rb +0 -442
- data/vendor/gems/rest-client/spec/resource_spec.rb +0 -75
- data/vendor/gems/rest-client/spec/response_spec.rb +0 -16
- data/vendor/gems/rest-client/spec/restclient_spec.rb +0 -53
@@ -1,52 +1,37 @@
|
|
1
|
-
module PoolParty
|
1
|
+
module PoolParty
|
2
2
|
module Remote
|
3
3
|
|
4
|
-
class MetavirtInstance
|
5
|
-
|
6
|
-
|
7
|
-
def initialize(o={}, cld=nil)
|
8
|
-
@ip = o[:ip]
|
9
|
-
@keypair = o[:keypair]
|
10
|
-
@cloud = cld
|
11
|
-
end
|
4
|
+
class MetavirtInstance < RemoteInstance
|
5
|
+
dsl_methods :mac_address,
|
6
|
+
:vmx_file
|
12
7
|
|
13
8
|
def to_hash
|
14
9
|
{
|
15
|
-
:status
|
16
|
-
:mac_addresses
|
17
|
-
:ip
|
18
|
-
:instance_id
|
19
|
-
:internal_ip
|
20
|
-
:
|
10
|
+
:status => status,
|
11
|
+
:mac_addresses => mac_address,
|
12
|
+
:ip => ip,
|
13
|
+
:instance_id => instance_id,
|
14
|
+
:internal_ip => internal_ip,
|
15
|
+
:keypair_name => keypair.basename
|
21
16
|
}
|
22
17
|
end
|
23
18
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
31
|
-
# Is this instance pending?
|
32
|
-
def pending?
|
33
|
-
false
|
34
|
-
end
|
35
|
-
# Is this instance terminating?
|
36
|
-
def terminating?
|
37
|
-
false
|
38
|
-
end
|
39
|
-
# Has this instance been terminated?
|
40
|
-
def terminated?
|
41
|
-
false
|
19
|
+
def keypair(n=nil)
|
20
|
+
if n.nil?
|
21
|
+
@keypair ||= Key.new(keypair_name)
|
22
|
+
else
|
23
|
+
@keypair = Key.new(n)
|
24
|
+
end
|
42
25
|
end
|
43
26
|
|
44
27
|
def launch!
|
45
28
|
end
|
46
|
-
|
29
|
+
|
30
|
+
def terminate!
|
31
|
+
`virsh destroy #{instance_id}`
|
47
32
|
end
|
48
33
|
|
49
|
-
end
|
34
|
+
end
|
50
35
|
|
51
36
|
end
|
52
37
|
end
|
@@ -38,7 +38,11 @@ module PoolParty
|
|
38
38
|
:vmx_hash => {}, # hash of vmx_filename => ip
|
39
39
|
:images_repo_path => ::File.expand_path("~/Documents/Virtual_Machines.localized/")
|
40
40
|
)
|
41
|
-
|
41
|
+
|
42
|
+
def image_id
|
43
|
+
next_unused_vmx_file
|
44
|
+
end
|
45
|
+
|
42
46
|
def vmx_files(n=nil)
|
43
47
|
if n.nil?
|
44
48
|
dsl_options[:vmx_files] || vmx_hash.keys
|
@@ -46,7 +50,7 @@ module PoolParty
|
|
46
50
|
dsl_options[:vmx_files] = n
|
47
51
|
end
|
48
52
|
end
|
49
|
-
|
53
|
+
|
50
54
|
def self.launch_new_instance!(o={})
|
51
55
|
# puts "launch_new_instance 0 = #{o.inspect}"
|
52
56
|
new(o).launch_new_instance!
|
@@ -56,8 +60,8 @@ module PoolParty
|
|
56
60
|
vmx_file = next_unused_vmx_file
|
57
61
|
VmwareInstance.new( {:vmx_file => vmx_file,
|
58
62
|
:public_ip => ip(vmx_file),
|
59
|
-
:ip
|
60
|
-
:keypair
|
63
|
+
:ip => ip(vmx_file),
|
64
|
+
:keypair => keypair
|
61
65
|
}.merge(o)
|
62
66
|
).launch!
|
63
67
|
end
|
@@ -85,8 +89,7 @@ module PoolParty
|
|
85
89
|
new(o).describe_instances
|
86
90
|
end
|
87
91
|
def describe_instances(o={})
|
88
|
-
|
89
|
-
running_instances.map {|a| a.to_hash.merge(:public_ip => ip(a.vmx_file), :ip => ip(a.vmx_file)) }
|
92
|
+
running_instances
|
90
93
|
end
|
91
94
|
|
92
95
|
# After launch callback
|
@@ -109,16 +112,31 @@ module PoolParty
|
|
109
112
|
end
|
110
113
|
end
|
111
114
|
|
115
|
+
# def id(vfile=nil)
|
116
|
+
# vfile.nil? ? : vmx_files[vfile]
|
117
|
+
# end
|
118
|
+
# alias :image_id :id
|
119
|
+
|
112
120
|
private
|
113
121
|
|
114
122
|
def running_instances(o={})
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
123
|
+
vmx_hash.map do |vmx_file, ip|
|
124
|
+
VmwareInstance.new( {:vmx_file => vmx_file,
|
125
|
+
:public_ip => ip,
|
126
|
+
:ip => ip,
|
127
|
+
:keypair => keypair
|
128
|
+
}.merge(o) )
|
129
|
+
end || {}
|
130
|
+
# output = run_local "#{path_to_binary} list"
|
131
|
+
# lines = output.split("\n")
|
132
|
+
# lines.shift
|
133
|
+
# lines.map {|vmx_file|
|
134
|
+
# VmwareInstance.new( {:vmx_file => vmx_file,
|
135
|
+
# :public_ip => ip(vmx_file),
|
136
|
+
# :ip => ip(vmx_file),
|
137
|
+
# :keypair => keypair
|
138
|
+
# }.merge(o) )
|
139
|
+
# }
|
122
140
|
end
|
123
141
|
|
124
142
|
# vmrun specific methods
|
@@ -144,15 +162,15 @@ module PoolParty
|
|
144
162
|
running_instances.last.vmx_file
|
145
163
|
end
|
146
164
|
|
147
|
-
def id(vfile)
|
148
|
-
vmx_file(vfile)
|
149
|
-
end
|
150
|
-
|
151
165
|
## method's to override default RemoteInstance
|
152
166
|
def instance_id
|
153
167
|
vmx_file
|
154
168
|
end
|
155
169
|
|
170
|
+
def keypair
|
171
|
+
cloud.keypair_name
|
172
|
+
end
|
173
|
+
|
156
174
|
def ip(vmx_file_string=nil)
|
157
175
|
return dsl_options[:ip] if dsl_options[:ip]
|
158
176
|
vmx_file_string ? vmx_hash[vmx_file_string] : nil
|
@@ -1,35 +1,34 @@
|
|
1
|
-
module PoolParty
|
1
|
+
module PoolParty
|
2
2
|
module Remote
|
3
3
|
|
4
|
-
class VmwareInstance
|
5
|
-
|
4
|
+
class VmwareInstance < RemoteInstance
|
5
|
+
include ::PoolParty::Pinger
|
6
6
|
|
7
|
-
|
7
|
+
dsl_methods :mac_address, :vmx_file, :keypair
|
8
|
+
|
9
|
+
def initialize(o={})
|
8
10
|
raise "You must pass a vmx_file" unless o[:vmx_file]
|
9
11
|
@vmx_file = ::File.expand_path(o[:vmx_file])
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
@cloud = cld
|
12
|
+
# o.delete(:status)
|
13
|
+
super o
|
14
14
|
end
|
15
15
|
|
16
16
|
def to_hash
|
17
|
-
{ :status
|
18
|
-
:mac_address
|
19
|
-
:ip
|
20
|
-
:public_ip
|
21
|
-
:internal_ip
|
22
|
-
:instance_id
|
23
|
-
:vmx_file
|
24
|
-
:keypair
|
17
|
+
{ :status => status,
|
18
|
+
:mac_address => mac_address,
|
19
|
+
:ip => ip,
|
20
|
+
:public_ip => ip,
|
21
|
+
:internal_ip => ip,
|
22
|
+
:instance_id => vmx_file,
|
23
|
+
:vmx_file => vmx_file,
|
24
|
+
:keypair => keypair
|
25
25
|
}
|
26
26
|
end
|
27
|
-
|
28
|
-
to_hash[k]
|
29
|
-
end
|
27
|
+
|
30
28
|
def status
|
31
|
-
"running"
|
32
|
-
end
|
29
|
+
ping_port(ip, 22, 1) ? "running" : "terminated"
|
30
|
+
end
|
31
|
+
|
33
32
|
# Is this instance running?
|
34
33
|
def running?
|
35
34
|
true
|
@@ -46,30 +45,39 @@ module PoolParty
|
|
46
45
|
def terminated?
|
47
46
|
false
|
48
47
|
end
|
48
|
+
|
49
49
|
def launch!
|
50
50
|
Vmrun.run_local("#{Vmrun.path_to_binary} start \"#{vmx_file}\"")
|
51
51
|
dputs "Launched new vmware instance from vmx: #{vmx_file}"
|
52
52
|
to_hash
|
53
53
|
end
|
54
|
+
|
54
55
|
def terminate!(o)
|
55
56
|
Vmrun.run_local("#{Vmrun.path_to_binary} stop \"#{vmx_file}\" #{o}")
|
56
57
|
end
|
58
|
+
|
57
59
|
# Get the ip from the arp -a
|
58
60
|
# def ip
|
59
61
|
# @ip ||= %x[arp -a].select {|a| a if a =~ /#{mac_address.macify}/}.first[/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/]
|
60
62
|
# end
|
61
63
|
# Get the mac address in the vmx_file
|
62
|
-
def mac_address
|
63
|
-
|
64
|
+
def mac_address(mac=nil)
|
65
|
+
if mac.nil?
|
66
|
+
dsl_options[:mac_address] ||= parse_vmx_file[:"ethernet0.generatedAddress"]
|
67
|
+
else
|
68
|
+
dsl_options[:mac_address] = mac
|
69
|
+
end
|
64
70
|
end
|
71
|
+
|
65
72
|
def parse_vmx_file
|
66
73
|
vmx_data.to_hash
|
67
74
|
end
|
75
|
+
|
68
76
|
def vmx_data
|
69
77
|
@vmx_data ||= open(vmx_file).read
|
70
78
|
end
|
71
79
|
|
72
|
-
end
|
80
|
+
end
|
73
81
|
|
74
82
|
end
|
75
83
|
end
|
@@ -1,28 +1,14 @@
|
|
1
|
+
$:.unshift(::File.dirname(__FILE__))
|
1
2
|
require "tempfile"
|
3
|
+
require "chef_deploy"
|
4
|
+
require "chef_library"
|
5
|
+
require "chef_recipe"
|
6
|
+
require "include_chef_recipe"
|
7
|
+
|
2
8
|
# BIG TODO: Slim the place where the content is gathered from
|
3
9
|
module PoolParty
|
4
|
-
|
5
|
-
class ::PoolParty::Resources::ChefRecipe < ::PoolParty::Resources::Resource
|
6
|
-
dsl_methods :recipes
|
7
|
-
end
|
8
|
-
|
9
|
-
class ::PoolParty::Resources::ChefLibrary < ::PoolParty::Resources::Resource
|
10
|
-
end
|
11
|
-
|
12
|
-
module Plugin
|
13
|
-
# class ChefRecipe
|
14
|
-
# include Dslify
|
15
|
-
# dsl_methods :recipes
|
16
|
-
# end
|
17
10
|
|
18
|
-
|
19
|
-
def loaded(opts={}, &block)
|
20
|
-
has_chef_recipe ::File.basename(name)
|
21
|
-
end
|
22
|
-
def before_configure
|
23
|
-
::Suitcase::Zipper.add(name, "chef/cookbooks") if ::File.exist?(name)
|
24
|
-
end
|
25
|
-
end
|
11
|
+
module Plugin
|
26
12
|
|
27
13
|
class Chef < Plugin
|
28
14
|
def before_load(o, &block)
|
@@ -93,11 +79,11 @@ module PoolParty
|
|
93
79
|
end
|
94
80
|
else
|
95
81
|
unless @recipe
|
96
|
-
@recipe = has_chef_recipe "poolparty", &block
|
97
|
-
@recipe.instance_eval(&block) if block
|
98
|
-
@recipe.recipes(recipe_files.empty? ? ["poolparty"] : ["poolparty", "main"])
|
99
|
-
|
100
|
-
::Suitcase::Zipper.add_content_as(
|
82
|
+
# @recipe = has_chef_recipe "poolparty", &block
|
83
|
+
# @recipe.instance_eval(&block) if block
|
84
|
+
# @recipe.recipes(recipe_files.empty? ? ["poolparty"] : ["poolparty", "main"])
|
85
|
+
dna_content = recipe_files.empty? ? ["poolparty"] : ["poolparty", "main"]
|
86
|
+
::Suitcase::Zipper.add_content_as({:recipes => dna_content}.to_json, "dna.json", "chef")
|
101
87
|
|
102
88
|
configure_commands ["cp -f /var/poolparty/dr_configure/chef/dna.json /etc/chef/dna.json"]
|
103
89
|
end
|
@@ -15,30 +15,13 @@
|
|
15
15
|
end
|
16
16
|
|
17
17
|
=end
|
18
|
+
require "chef_deploy_definition"
|
19
|
+
|
18
20
|
module PoolParty
|
19
21
|
module Plugin
|
20
22
|
|
21
23
|
class ChefDeploy < Plugin
|
22
24
|
|
23
|
-
define_resource :chef_deploy_definition do
|
24
|
-
|
25
|
-
dsl_methods :repo
|
26
|
-
|
27
|
-
default_options(
|
28
|
-
:branch => "HEAD",
|
29
|
-
:enable_submodules => true,
|
30
|
-
:migrate => true,
|
31
|
-
:environment => "production",
|
32
|
-
:shallow_clone => true,
|
33
|
-
:user => "www-data",
|
34
|
-
:restart_command => "touch tmp/restart.txt",
|
35
|
-
:migration_command => "rake db:migrate"
|
36
|
-
)
|
37
|
-
def present
|
38
|
-
:deploy
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
25
|
dsl_methods :branch, :enable_submodules, :migrate, :environment, :shallow_clone, :user,
|
43
26
|
:restart_command, :migration_command, :repo
|
44
27
|
|
@@ -48,17 +31,16 @@ module PoolParty
|
|
48
31
|
else
|
49
32
|
raise ::ReposMissingError.new unless repo
|
50
33
|
has_chef_library "chef-deploy/lib/chef-deploy.rb"
|
51
|
-
has_chef_deploy_definition(
|
34
|
+
has_chef_deploy_definition(default_options.merge(:to => name))
|
52
35
|
end
|
53
36
|
end
|
54
37
|
|
55
38
|
def before_configure
|
56
39
|
configure_commands [
|
57
40
|
"mkdir -p /etc/chef/lib",
|
58
|
-
"cp -R /var/poolparty/dr_configure/etc/chef/lib /etc/chef"
|
41
|
+
"if [ -d /var/poolparty/dr_configure/etc/chef/lib ] ; then cp -R /var/poolparty/dr_configure/etc/chef/lib /etc/chef; fi"
|
59
42
|
]
|
60
|
-
::Suitcase::Zipper.add("#{::File.dirname(__FILE__)}
|
61
|
-
"etc/chef/lib")
|
43
|
+
::Suitcase::Zipper.add("#{::File.dirname(__FILE__)}/../../../../vendor/chef/chef-deploy", "etc/chef/lib")
|
62
44
|
end
|
63
45
|
|
64
46
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module PoolParty
|
2
|
+
module Resources
|
3
|
+
class ChefDeployDefinition < Resource
|
4
|
+
|
5
|
+
dsl_methods :repo
|
6
|
+
|
7
|
+
default_options(
|
8
|
+
:branch => "HEAD",
|
9
|
+
:enable_submodules => true,
|
10
|
+
:migrate => true,
|
11
|
+
:environment => "production",
|
12
|
+
:shallow_clone => true,
|
13
|
+
:user => "www-data",
|
14
|
+
:restart_command => "touch tmp/restart.txt",
|
15
|
+
:migration_command => "rake db:migrate"
|
16
|
+
)
|
17
|
+
|
18
|
+
def to_properties_hash
|
19
|
+
{:pp_type => "deploy", :name => "#{to}"}.merge!(default_options)
|
20
|
+
end
|
21
|
+
|
22
|
+
def to(n=nil)
|
23
|
+
@to ||= n.nil? ? "/var/www" : n
|
24
|
+
end
|
25
|
+
|
26
|
+
def present
|
27
|
+
:deploy
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module PoolParty
|
2
|
+
module Plugin
|
3
|
+
|
4
|
+
class IncludeChefRecipe < Plugin
|
5
|
+
def loaded(opts={}, &block)
|
6
|
+
has_chef_recipe ::File.basename(name)
|
7
|
+
end
|
8
|
+
def before_configure
|
9
|
+
::Suitcase::Zipper.add(name, "chef/cookbooks") if ::File.exist?(name)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|