poolparty 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/poolparty/chef.rb +9 -4
- data/lib/poolparty/chef_solo.rb +10 -4
- metadata +2 -2
data/VERSION.yml
CHANGED
data/lib/poolparty/chef.rb
CHANGED
@@ -55,16 +55,17 @@ module PoolParty
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def node_bootsrapped?(remote_instance)
|
58
|
-
|
58
|
+
# "(gem list; dpkg -l chef) | grep -q chef && echo 'chef installed'"
|
59
|
+
remote_instance.ssh(['if [ ! -n "$(gem list 2>/dev/null | grep chef)" ]; then echo "chef installed"; fi'], :do_sudo => false).empty? rescue false
|
59
60
|
end
|
60
|
-
def node_bootstrap
|
61
|
+
def node_bootstrap(remote_instance)
|
61
62
|
remote_instance.ssh([
|
62
63
|
'apt-get update',
|
63
64
|
'apt-get autoremove -y',
|
64
65
|
'apt-get install -y ruby ruby-dev rubygems git-core libopenssl-ruby',
|
65
66
|
'gem sources -a http://gems.opscode.com',
|
66
67
|
'gem install chef ohai --no-rdoc --no-ri' ])
|
67
|
-
remote_instance.ssh(remote_instance.bootstrap_gems.collect { |
|
68
|
+
remote_instance.ssh(remote_instance.bootstrap_gems.collect { |g| "gem install #{g} --no-rdoc --no-ri" } )
|
68
69
|
end
|
69
70
|
private
|
70
71
|
|
@@ -73,7 +74,11 @@ module PoolParty
|
|
73
74
|
end
|
74
75
|
|
75
76
|
def method_missing(m,*args,&block)
|
76
|
-
|
77
|
+
if cloud.respond_to?(m)
|
78
|
+
cloud.send(m,*args,&block)
|
79
|
+
else
|
80
|
+
super
|
81
|
+
end
|
77
82
|
end
|
78
83
|
|
79
84
|
end
|
data/lib/poolparty/chef_solo.rb
CHANGED
@@ -16,22 +16,28 @@ module PoolParty
|
|
16
16
|
# The NEW actual chef resolver.
|
17
17
|
def build_tmp_dir
|
18
18
|
base_directory = tmp_path/"etc"/"chef"
|
19
|
-
|
19
|
+
roles_dir = "#{base_directory}/roles"
|
20
|
+
FileUtils.rm_rf base_directory # cleanup old chef temp directory
|
20
21
|
puts "Copying the chef-repo into the base directory from #{repo}"
|
21
|
-
|
22
|
+
|
23
|
+
FileUtils.mkdir_p base_directory
|
22
24
|
if File.directory?(repo)
|
23
25
|
if File.exist?(base_directory)
|
24
26
|
# First remove the directory
|
25
27
|
FileUtils.remove_entry base_directory, :force => true
|
26
28
|
end
|
27
|
-
|
29
|
+
cookbook_path = "#{base_directory}/cookbooks"
|
30
|
+
FileUtils.mkdir_p cookbook_path
|
31
|
+
FileUtils.cp_r "#{repo}/.", cookbook_path
|
28
32
|
else
|
29
33
|
raise "#{repo} chef repo directory does not exist"
|
30
34
|
end
|
31
35
|
puts "Creating the dna.json"
|
32
36
|
attributes.to_dna [], base_directory/"dna.json", {:run_list => ["role[#{cloud.name}]"]}
|
33
37
|
write_solo_dot_rb
|
34
|
-
|
38
|
+
# Make sure the roles directory exists
|
39
|
+
FileUtils.mkdir_p roles_dir
|
40
|
+
write_chef_role_json "#{roles_dir}/#{cloud.name}.json"
|
35
41
|
end
|
36
42
|
|
37
43
|
def write_solo_dot_rb(to=tmp_path/"etc"/"chef"/"solo.rb")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poolparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ari Lerner
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2010-03-
|
14
|
+
date: 2010-03-18 00:00:00 -07:00
|
15
15
|
default_executable:
|
16
16
|
dependencies: []
|
17
17
|
|