knife-solo 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chef/knife/cook.rb +6 -12
- data/lib/chef/knife/kitchen.rb +6 -5
- data/lib/chef/knife/prepare.rb +4 -0
- data/lib/knife-solo/bootstraps.rb +7 -1
- data/lib/knife-solo/bootstraps/linux.rb +1 -1
- data/lib/knife-solo/info.rb +1 -1
- metadata +49 -16
data/lib/chef/knife/cook.rb
CHANGED
@@ -13,6 +13,9 @@ class Chef
|
|
13
13
|
# Approach ported from spatula (https://github.com/trotter/spatula)
|
14
14
|
# Copyright 2009, Trotter Cashion
|
15
15
|
class Cook < Knife
|
16
|
+
OMNIBUS_EMBEDDED_PATHS = ["/opt/chef/embedded/bin", "/opt/opscode/embedded/bin"]
|
17
|
+
CHEF_VERSION_CONSTRAINT = ">=0.10.4"
|
18
|
+
|
16
19
|
include KnifeSolo::SshCommand
|
17
20
|
include KnifeSolo::KitchenCommand
|
18
21
|
include KnifeSolo::Tools
|
@@ -100,20 +103,11 @@ class Chef
|
|
100
103
|
end
|
101
104
|
|
102
105
|
def check_chef_version
|
103
|
-
constraint = "~>0.10.4"
|
104
106
|
result = run_command <<-BASH
|
105
|
-
|
106
|
-
|
107
|
-
if command -v $opscode_ruby &>/dev/null
|
108
|
-
then
|
109
|
-
ruby_bin=$opscode_ruby
|
110
|
-
else
|
111
|
-
ruby_bin="ruby"
|
112
|
-
fi
|
113
|
-
|
114
|
-
$ruby_bin -rubygems -e "gem 'chef', '#{constraint}'"
|
107
|
+
export PATH="#{OMNIBUS_EMBEDDED_PATHS.join(":")}:$PATH"
|
108
|
+
ruby -rubygems -e "gem 'chef', '#{CHEF_VERSION_CONSTRAINT}'"
|
115
109
|
BASH
|
116
|
-
raise "Couldn't find Chef #{
|
110
|
+
raise "Couldn't find Chef #{CHEF_VERSION_CONSTRAINT} on #{host}. Please run `#{$0} prepare #{ssh_args}` to ensure Chef is installed and up to date." unless result.success?
|
117
111
|
end
|
118
112
|
|
119
113
|
def cook
|
data/lib/chef/knife/kitchen.rb
CHANGED
@@ -16,11 +16,12 @@ class Chef
|
|
16
16
|
end
|
17
17
|
File.open(name + "/solo.rb", 'w') do |f|
|
18
18
|
f << <<-RUBY.gsub(/^ {12}/, '')
|
19
|
-
file_cache_path
|
20
|
-
data_bag_path
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
file_cache_path "/tmp/chef-solo"
|
20
|
+
data_bag_path "/tmp/chef-solo/data_bags"
|
21
|
+
encrypted_data_bag_secret "/tmp/chef-solo/data_bag_key"
|
22
|
+
cookbook_path [ "/tmp/chef-solo/site-cookbooks",
|
23
|
+
"/tmp/chef-solo/cookbooks" ]
|
24
|
+
role_path "/tmp/chef-solo/roles"
|
24
25
|
RUBY
|
25
26
|
end
|
26
27
|
end
|
data/lib/chef/knife/prepare.rb
CHANGED
@@ -57,7 +57,13 @@ module KnifeSolo
|
|
57
57
|
|
58
58
|
def omnibus_install
|
59
59
|
run_command(http_client_get_url("http://opscode.com/chef/install.sh"))
|
60
|
-
|
60
|
+
|
61
|
+
# `release_version` within install.sh will be installed if
|
62
|
+
# `omnibus_version` is not provided.
|
63
|
+
install_command = "sudo bash install.sh"
|
64
|
+
install_command << " -v #{prepare.config[:omnibus_version]}" if prepare.config[:omnibus_version]
|
65
|
+
|
66
|
+
run_command(install_command)
|
61
67
|
end
|
62
68
|
|
63
69
|
def ubuntu_omnibus_install
|
@@ -77,7 +77,7 @@ module KnifeSolo::Bootstraps
|
|
77
77
|
{:type => "omnibus", :version => "squeeze"}
|
78
78
|
when %r{Debian GNU/Linux wheezy}
|
79
79
|
{:type => "debian_gem", :version => "wheezy"}
|
80
|
-
when %r{Ubuntu}
|
80
|
+
when %r{Ubuntu}i
|
81
81
|
version = run_command("lsb_release -cs").stdout.strip
|
82
82
|
{:type => "ubuntu_omnibus", :version => version}
|
83
83
|
when %r{Linaro}
|
data/lib/knife-solo/info.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-solo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: mocha
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,21 +37,31 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: chef
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
|
-
- -
|
51
|
+
- - ! '>='
|
42
52
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.10.
|
53
|
+
version: 0.10.10
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.10.10
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: net-ssh
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -57,10 +72,18 @@ dependencies:
|
|
57
72
|
version: 2.3.0
|
58
73
|
type: :runtime
|
59
74
|
prerelease: false
|
60
|
-
version_requirements:
|
75
|
+
version_requirements: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 2.1.3
|
81
|
+
- - <
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 2.3.0
|
61
84
|
- !ruby/object:Gem::Dependency
|
62
85
|
name: librarian
|
63
|
-
requirement:
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
64
87
|
none: false
|
65
88
|
requirements:
|
66
89
|
- - ~>
|
@@ -68,7 +91,12 @@ dependencies:
|
|
68
91
|
version: 0.0.20
|
69
92
|
type: :runtime
|
70
93
|
prerelease: false
|
71
|
-
version_requirements:
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ~>
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 0.0.20
|
72
100
|
description: Handles bootstrapping, running chef solo, rsyncing cookbooks etc
|
73
101
|
email: mat@schaffer.me
|
74
102
|
executables: []
|
@@ -101,17 +129,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
129
|
- - ! '>='
|
102
130
|
- !ruby/object:Gem::Version
|
103
131
|
version: '0'
|
132
|
+
segments:
|
133
|
+
- 0
|
134
|
+
hash: -4055185627370622040
|
104
135
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
136
|
none: false
|
106
137
|
requirements:
|
107
138
|
- - ! '>='
|
108
139
|
- !ruby/object:Gem::Version
|
109
140
|
version: '0'
|
141
|
+
segments:
|
142
|
+
- 0
|
143
|
+
hash: -4055185627370622040
|
110
144
|
requirements: []
|
111
145
|
rubyforge_project: nowarning
|
112
|
-
rubygems_version: 1.8.
|
146
|
+
rubygems_version: 1.8.24
|
113
147
|
signing_key:
|
114
148
|
specification_version: 3
|
115
149
|
summary: A collection of knife plugins for dealing with chef solo
|
116
150
|
test_files: []
|
117
|
-
has_rdoc:
|