knife-setup 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chef/knife/knife-setup.rb +21 -1
- data/lib/knife-setup/version.rb +1 -1
- metadata +3 -3
@@ -12,6 +12,8 @@ class Chef
|
|
12
12
|
require 'highline'
|
13
13
|
require 'net/ssh'
|
14
14
|
require 'net/ssh/multi'
|
15
|
+
require 'net/http'
|
16
|
+
require 'uri'
|
15
17
|
Chef::Knife::Ssh.load_deps
|
16
18
|
end
|
17
19
|
|
@@ -186,7 +188,11 @@ class Chef
|
|
186
188
|
set_run_list(get_node, config[:run_list]) unless config[:run_list].empty?
|
187
189
|
set_env(get_node, config[:environment]) unless config[:environment] == "_default"
|
188
190
|
knife_ssh("chef-client").run if config[:norunchef]
|
189
|
-
|
191
|
+
post if Chef::Config[:knife][:post_url]
|
192
|
+
end
|
193
|
+
|
194
|
+
def post_after
|
195
|
+
|
190
196
|
end
|
191
197
|
|
192
198
|
def validate_name_args!
|
@@ -231,6 +237,20 @@ class Chef
|
|
231
237
|
command
|
232
238
|
end
|
233
239
|
|
240
|
+
def post
|
241
|
+
url = Chef::Config[:knife][:post_url]
|
242
|
+
message = {
|
243
|
+
:fqdn => get_node[:fqdn]
|
244
|
+
}
|
245
|
+
body = JSON.generate(message)
|
246
|
+
uri = URI.parse(url)
|
247
|
+
request = Net::HTTP::Post.new(uri.request_uri)
|
248
|
+
request.add_field('Content-Type', 'application/json-rpc')
|
249
|
+
request.body = body
|
250
|
+
response = http.request(request)
|
251
|
+
raise "HTTP Error: #{response.code} on #{url}" unless response.code == "200"
|
252
|
+
end
|
253
|
+
|
234
254
|
end
|
235
255
|
end
|
236
256
|
end
|
data/lib/knife-setup/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-setup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
version: '0'
|
62
62
|
requirements: []
|
63
63
|
rubyforge_project: knife-setup
|
64
|
-
rubygems_version: 1.8.
|
64
|
+
rubygems_version: 1.8.25
|
65
65
|
signing_key:
|
66
66
|
specification_version: 3
|
67
67
|
summary: Setup chef on machine.
|