knife-rackspace 0.8.0 → 0.8.1
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.
- checksums.yaml +8 -8
- data/CHANGELOG.md +3 -0
- data/lib/chef/knife/rackspace_base.rb +5 -1
- data/lib/chef/knife/rackspace_server_create.rb +47 -0
- data/lib/knife-rackspace/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjY5N2QxMDNkZTRmNWU4ZTNiZTM4OTZjM2ZiNTAzNTc0NDA2YzFjNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmIxNTg4Njc1ZDczOWFkMzE2Y2ZhNGU5OWI5MmU1OTdkMmUzMGJlMg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTA4MjgwZDM0NTg5ZmI0Y2RkYzg0NDg3NmY4OGMzNTBhOGU3NTYwNDM0MWRj
|
10
|
+
YTk1ZjM2N2YzZjk1Nzc5ODcyMjRjZDM3ZWIzNTQxMWMxZTI3OTA5MmViYjNm
|
11
|
+
YTdhNzRmZWZkN2EzMWE2NDJiZTNjNzAxZTQ2NzZmNjcxYjRkOGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTMwOTg0MzcxMTFlOGM1MTE3NmJlMWI4MGZmYTZmNmVmMDY0NjllMThjZDg2
|
14
|
+
YmUyOTkyZjgyMzJhMjcxY2MwZDI4NDI1ZTE1MzJhM2M2NGJhYTBmYzQxMTM4
|
15
|
+
YTE3ZTEwYmVhZTVjMzljNWFkNzAzNThhYjg2YWM1OGNlODk5NmU=
|
data/CHANGELOG.md
CHANGED
@@ -154,7 +154,7 @@ class Chef
|
|
154
154
|
if version_one?
|
155
155
|
v1_public_ip(server)
|
156
156
|
else
|
157
|
-
v2_public_ip(server)
|
157
|
+
v2_access_ip(server) ? v2_access_ip(server) : v2_public_ip(server)
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
@@ -205,6 +205,10 @@ class Chef
|
|
205
205
|
extract_ipv4_address(private_ips) if private_ips
|
206
206
|
end
|
207
207
|
|
208
|
+
def v2_access_ip(server)
|
209
|
+
server.access_ipv4_address == nil ? "" : server.access_ipv4_address
|
210
|
+
end
|
211
|
+
|
208
212
|
def extract_ipv4_address(ip_addresses)
|
209
213
|
address = ip_addresses.select { |ip| ip["version"] == 4 }.first
|
210
214
|
address ? address["addr"] : ""
|
@@ -136,6 +136,18 @@ class Chef
|
|
136
136
|
:proc => Proc.new { |m| Chef::Config[:knife][:rackspace_metadata] = JSON.parse(m) },
|
137
137
|
:default => ""
|
138
138
|
|
139
|
+
option :rackconnect_wait,
|
140
|
+
:long => "--rackconnect-wait",
|
141
|
+
:description => "Wait until the Rackconnect automation setup is complete before bootstrapping chef",
|
142
|
+
:boolean => true,
|
143
|
+
:default => false
|
144
|
+
|
145
|
+
option :rackspace_servicelevel_wait,
|
146
|
+
:long => "--rackspace-servicelevel-wait",
|
147
|
+
:description => "Wait until the Rackspace service level automation setup is complete before bootstrapping chef",
|
148
|
+
:boolean => true,
|
149
|
+
:default => false
|
150
|
+
|
139
151
|
option :hint,
|
140
152
|
:long => "--hint HINT_NAME[=HINT_FILE]",
|
141
153
|
:description => "Specify Ohai Hint to be set on the bootstrap target. Use multiple --hint options to specify multiple hints.",
|
@@ -296,6 +308,9 @@ class Chef
|
|
296
308
|
node_name = get_node_name(config[:chef_node_name] || config[:server_name])
|
297
309
|
networks = get_networks(Chef::Config[:knife][:rackspace_networks])
|
298
310
|
|
311
|
+
rackconnect_wait = Chef::Config[:knife][:rackconnect_wait] || config[:rackconnect_wait]
|
312
|
+
rackspace_servicelevel_wait = Chef::Config[:knife][:rackspace_servicelevel_wait] || config[:rackspace_servicelevel_wait]
|
313
|
+
|
299
314
|
server = connection.servers.new(
|
300
315
|
:name => node_name,
|
301
316
|
:image_id => Chef::Config[:knife][:image],
|
@@ -316,6 +331,36 @@ class Chef
|
|
316
331
|
msg_pair("Name", server.name)
|
317
332
|
msg_pair("Flavor", server.flavor.name)
|
318
333
|
msg_pair("Image", server.image.name)
|
334
|
+
msg_pair("Metadata", server.metadata.all)
|
335
|
+
msg_pair("RackConnect Wait", rackconnect_wait ? 'yes' : 'no')
|
336
|
+
msg_pair("ServiceLevel Wait", rackspace_servicelevel_wait ? 'yes' : 'no')
|
337
|
+
|
338
|
+
# wait for it to be ready to do stuff
|
339
|
+
begin
|
340
|
+
server.wait_for(1200) {
|
341
|
+
print ".";
|
342
|
+
Chef::Log.debug("#{progress}%")
|
343
|
+
if rackconnect_wait and rackspace_servicelevel_wait
|
344
|
+
Chef::Log.debug("rackconnect_automation_status: #{metadata.all['rackconnect_automation_status']}")
|
345
|
+
Chef::Log.debug("rax_service_level_automation: #{metadata.all['rax_service_level_automation']}")
|
346
|
+
ready? and metadata.all['rackconnect_automation_status'] == 'DEPLOYED' and metadata.all['rax_service_level_automation'] == 'Complete'
|
347
|
+
elsif rackconnect_wait
|
348
|
+
Chef::Log.debug("rackconnect_automation_status: #{metadata.all['rackconnect_automation_status']}")
|
349
|
+
ready? and metadata.all['rackconnect_automation_status'] == 'DEPLOYED'
|
350
|
+
elsif rackspace_servicelevel_wait
|
351
|
+
Chef::Log.debug("rax_service_level_automation: #{metadata.all['rax_service_level_automation']}")
|
352
|
+
ready? and metadata.all['rax_service_level_automation'] == 'Complete'
|
353
|
+
else
|
354
|
+
ready?
|
355
|
+
end
|
356
|
+
}
|
357
|
+
rescue Fog::Errors::TimeoutError
|
358
|
+
ui.error('Timeout waiting for the server to be created')
|
359
|
+
msg_pair('Progress', "#{server.progress}%")
|
360
|
+
msg_pair('rackconnect_automation_status', server.metadata.all['rackconnect_automation_status'])
|
361
|
+
msg_pair('rax_service_level_automation', server.metadata.all['rax_service_level_automation'])
|
362
|
+
Chef::Application.fatal! 'Server didn\'t finish on time'
|
363
|
+
end
|
319
364
|
msg_pair("Metadata", server.metadata)
|
320
365
|
if(networks && Chef::Config[:knife][:rackspace_networks])
|
321
366
|
msg_pair("Networks", Chef::Config[:knife][:rackspace_networks].sort.join(', '))
|
@@ -332,6 +377,8 @@ class Chef
|
|
332
377
|
msg_pair("Public IP Address", public_ip(server))
|
333
378
|
msg_pair("Private IP Address", private_ip(server))
|
334
379
|
msg_pair("Password", server.password)
|
380
|
+
msg_pair("Metadata", server.metadata.all)
|
381
|
+
|
335
382
|
#which IP address to bootstrap
|
336
383
|
bootstrap_ip_address = public_ip(server)
|
337
384
|
if config[:private_network]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-rackspace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-09-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: knife-windows
|