lib/chef/knife/profitbricks_volume_create.rb in knife-profitbricks-1.1.2 vs lib/chef/knife/profitbricks_volume_create.rb in knife-profitbricks-1.2.0
- old
+ new
@@ -55,10 +55,16 @@
short: '-K SSHKEY[,SSHKEY,...]',
long: '--ssh-keys SSHKEY1,SSHKEY2,...',
description: 'A list of public SSH keys to include',
proc: proc { |sshkeys| sshkeys.split(',') }
+ option :volume_availability_zone,
+ short: '-Z AVAILABILITY_ZONE',
+ long: '--availability-zone AVAILABILITY_ZONE',
+ description: 'The volume availability zone of the server',
+ required: false
+
def run
$stdout.sync = true
print "#{ui.color('Creating volume...', :magenta)}"
@@ -77,10 +83,14 @@
if config[:imagepassword]
params[:imagePassword] = config[:imagepassword]
end
+ if config[:volume_availability_zone]
+ params[:availabilityZone] = config[:volume_availability_zone]
+ end
+
connection
volume = ProfitBricks::Volume.create(
config[:datacenter_id],
params.compact
)
@@ -95,9 +105,10 @@
puts "#{ui.color('Size', :cyan)}: #{volume.properties['size']}"
puts "#{ui.color('Bus', :cyan)}: #{volume.properties['bus']}"
puts "#{ui.color('Image', :cyan)}: #{volume.properties['image']}"
puts "#{ui.color('Type', :cyan)}: #{volume.properties['type']}"
puts "#{ui.color('Licence Type', :cyan)}: #{volume.properties['licenceType']}"
+ puts "#{ui.color('Zone', :cyan)}: #{volume.properties['availabilityZone']}"
puts 'done'
end
end
end
end