knife-profitbricks 1.0.0 → 1.1.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 +4 -4
- data/README.md +9 -1
- data/knife-profitbricks.gemspec +1 -1
- data/lib/chef/knife/profitbricks_composite_server_create.rb +152 -0
- data/lib/chef/knife/profitbricks_datacenter_create.rb +4 -2
- data/lib/chef/knife/profitbricks_firewall_create.rb +2 -1
- data/lib/chef/knife/profitbricks_firewall_delete.rb +6 -3
- data/lib/chef/knife/profitbricks_firewall_list.rb +6 -3
- data/lib/chef/knife/profitbricks_ipblock_create.rb +4 -2
- data/lib/chef/knife/profitbricks_lan_create.rb +2 -1
- data/lib/chef/knife/profitbricks_lan_delete.rb +2 -1
- data/lib/chef/knife/profitbricks_lan_list.rb +2 -1
- data/lib/chef/knife/profitbricks_nic_create.rb +6 -3
- data/lib/chef/knife/profitbricks_nic_delete.rb +4 -2
- data/lib/chef/knife/profitbricks_nic_list.rb +4 -2
- data/lib/chef/knife/profitbricks_server_create.rb +8 -4
- data/lib/chef/knife/profitbricks_server_delete.rb +2 -1
- data/lib/chef/knife/profitbricks_server_list.rb +2 -1
- data/lib/chef/knife/profitbricks_server_reboot.rb +2 -1
- data/lib/chef/knife/profitbricks_server_start.rb +2 -1
- data/lib/chef/knife/profitbricks_server_stop.rb +2 -1
- data/lib/chef/knife/profitbricks_volume_attach.rb +4 -2
- data/lib/chef/knife/profitbricks_volume_create.rb +15 -5
- data/lib/chef/knife/profitbricks_volume_delete.rb +2 -1
- data/lib/chef/knife/profitbricks_volume_detach.rb +4 -2
- data/lib/chef/knife/profitbricks_volume_list.rb +4 -2
- data/lib/knife-profitbricks/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c011f2895721cbbe750f7b3f40fe053de452b66b
|
|
4
|
+
data.tar.gz: dfe89590df762d895b06bb2f6a27b4533754be0f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23642c6a6b059453ba9079225b70573f9c7d1634f676ec9f158eeb8a04349c2809fa850f5f3541a24b89774b8e9881ed309390c5a095955a4ec61f50ca733487
|
|
7
|
+
data.tar.gz: 5035a534767912ee91b4db6c6af04bc6955ee7a396304e2af28120979c094a9101e7fdda184ec47d8c1483b65a6a345d7ebf21d0c132b58194a0f5079064886b
|
data/README.md
CHANGED
|
@@ -111,6 +111,10 @@ Deletes an existing NIC from a server.
|
|
|
111
111
|
|
|
112
112
|
List all available NICs connected to a server.
|
|
113
113
|
|
|
114
|
+
### knife profitbricks composite server create
|
|
115
|
+
|
|
116
|
+
Creates a new composite server with attached volume and NIC in a specified data center.
|
|
117
|
+
|
|
114
118
|
### knife profitbricks server create
|
|
115
119
|
|
|
116
120
|
Creates a new server within a specified data center.
|
|
@@ -173,7 +177,7 @@ Now the data center can be created.
|
|
|
173
177
|
Once the data center is provisioned, both a server and volume can be created. The volume will use an existing image as identified above.
|
|
174
178
|
|
|
175
179
|
knife profitbricks server create --datacenter-id ade28808-9253-4d4e-9f5d-f1f7f1038fb1 --name "Frontend Webserver" --cores 1 --ram 1024 --availability-zone ZONE_1
|
|
176
|
-
knife profitbricks volume create --datacenter-id ade28808-9253-4d4e-9f5d-f1f7f1038fb1 --name "OS Volume" --size 5 --image c4263e0f-e75e-11e4-91fd-8fa3eaae9f6b
|
|
180
|
+
knife profitbricks volume create --datacenter-id ade28808-9253-4d4e-9f5d-f1f7f1038fb1 --name "OS Volume" --size 5 --type HDD --image c4263e0f-e75e-11e4-91fd-8fa3eaae9f6b --ssh-keys "ssh-rsa AAAAB3NzaC1..."
|
|
177
181
|
|
|
178
182
|
The volume can then be attached to the server.
|
|
179
183
|
|
|
@@ -187,6 +191,10 @@ Here is an example of adding a firewall rule to the newly created NIC.
|
|
|
187
191
|
|
|
188
192
|
knife profitbricks firewall create --datacenter-id ade28808-9253-4d4e-9f5d-f1f7f1038fb1 --server-id 2e438d3b-02f0-47d0-8594-4ace38ed2804 --nic-id e4270ecc-e9c5-4de0-940a-8a0a99d962fd --name "SSH" --protocol TCP --port-range-start 22 --port-range-end 22 --source-ip 203.0.113.10
|
|
189
193
|
|
|
194
|
+
A composite server can also be created with attached volume and NIC in a single command.
|
|
195
|
+
|
|
196
|
+
knife profitbricks composite server create --datacenter-id ade28808-9253-4d4e-9f5d-f1f7f1038fb1 --name "Backend Database" --cores 1 --ram 8192 --size 5 --type HDD --lan 1 --image 2ead2908-df61-11e5-80a4-52540005ab80 --ssh-keys "ssh-rsa AAAAB3NzaC1..."
|
|
197
|
+
|
|
190
198
|
The new data center and **all resources within that data center** can be deleted.
|
|
191
199
|
|
|
192
200
|
knife profitbricks datacenter delete ade28808-9253-4d4e-9f5d-f1f7f1038fb1
|
data/knife-profitbricks.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
19
|
spec.require_paths = ["lib"]
|
|
20
20
|
|
|
21
|
-
spec.add_runtime_dependency "profitbricks-sdk-ruby", "~> 1.
|
|
21
|
+
spec.add_runtime_dependency "profitbricks-sdk-ruby", "~> 1.1"
|
|
22
22
|
spec.add_runtime_dependency "chef", "~> 12"
|
|
23
23
|
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.6"
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
require 'chef/knife/profitbricks_base'
|
|
2
|
+
|
|
3
|
+
class Chef
|
|
4
|
+
class Knife
|
|
5
|
+
class ProfitbricksCompositeServerCreate < Knife
|
|
6
|
+
include Knife::ProfitbricksBase
|
|
7
|
+
|
|
8
|
+
banner 'knife profitbricks composite server create (options)'
|
|
9
|
+
|
|
10
|
+
option :datacenter_id,
|
|
11
|
+
short: '-D DATACENTER_UUID',
|
|
12
|
+
long: '--datacenter-id DATACENTER_UUID',
|
|
13
|
+
description: 'Name of the virtual datacenter',
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
16
|
+
|
|
17
|
+
option :name,
|
|
18
|
+
short: '-n NAME',
|
|
19
|
+
long: '--name NAME',
|
|
20
|
+
description: 'Name of the server',
|
|
21
|
+
required: true
|
|
22
|
+
|
|
23
|
+
option :cores,
|
|
24
|
+
short: '-C CORES',
|
|
25
|
+
long: '--cores CORES',
|
|
26
|
+
description: 'The number of processor cores',
|
|
27
|
+
required: true
|
|
28
|
+
|
|
29
|
+
option :ram,
|
|
30
|
+
short: '-r RAM',
|
|
31
|
+
long: '--ram RAM',
|
|
32
|
+
description: 'The amount of RAM in MB',
|
|
33
|
+
required: true
|
|
34
|
+
|
|
35
|
+
option :availabilityzone,
|
|
36
|
+
short: '-a AVAILABILITY_ZONE',
|
|
37
|
+
long: '--availability-zone AVAILABILITY_ZONE',
|
|
38
|
+
description: 'The availability zone of the server',
|
|
39
|
+
default: 'AUTO'
|
|
40
|
+
|
|
41
|
+
option :volumename,
|
|
42
|
+
long: '--volume-name NAME',
|
|
43
|
+
description: 'Name of the volume'
|
|
44
|
+
|
|
45
|
+
option :size,
|
|
46
|
+
short: '-S SIZE',
|
|
47
|
+
long: '--size SIZE',
|
|
48
|
+
description: 'The size of the volume in GB',
|
|
49
|
+
required: true
|
|
50
|
+
|
|
51
|
+
option :bus,
|
|
52
|
+
short: '-b BUS',
|
|
53
|
+
long: '--bus BUS',
|
|
54
|
+
description: 'The bus type of the volume (VIRTIO or IDE)'
|
|
55
|
+
|
|
56
|
+
option :image,
|
|
57
|
+
short: '-N UUID',
|
|
58
|
+
long: '--image UUID',
|
|
59
|
+
description: 'The image or snapshot UUID'
|
|
60
|
+
|
|
61
|
+
option :type,
|
|
62
|
+
short: '-t TYPE',
|
|
63
|
+
long: '--type TYPE',
|
|
64
|
+
description: 'The disk type; currently only HDD.',
|
|
65
|
+
required: true
|
|
66
|
+
|
|
67
|
+
option :licencetype,
|
|
68
|
+
short: '-l LICENCE',
|
|
69
|
+
long: '--licence-type LICENCE',
|
|
70
|
+
description: 'The licence type of the volume (LINUX, WINDOWS, UNKNOWN, OTHER)'
|
|
71
|
+
|
|
72
|
+
option :sshkeys,
|
|
73
|
+
short: '-K SSHKEY[,SSHKEY,...]',
|
|
74
|
+
long: '--ssh-keys SSHKEY1,SSHKEY2,...',
|
|
75
|
+
description: 'A list of public SSH keys to include',
|
|
76
|
+
proc: proc { |sshkeys| sshkeys.split(',') }
|
|
77
|
+
|
|
78
|
+
option :nicname,
|
|
79
|
+
long: '--name NAME',
|
|
80
|
+
description: 'Name of the NIC'
|
|
81
|
+
|
|
82
|
+
option :ips,
|
|
83
|
+
short: '-i IP[,IP,...]',
|
|
84
|
+
long: '--ips IP[,IP,...]',
|
|
85
|
+
description: 'IPs assigned to the NIC',
|
|
86
|
+
proc: proc { |ips| ips.split(',') }
|
|
87
|
+
|
|
88
|
+
option :dhcp,
|
|
89
|
+
short: '-h',
|
|
90
|
+
long: '--dhcp',
|
|
91
|
+
boolean: true | false,
|
|
92
|
+
default: true,
|
|
93
|
+
description: 'Set to false if you wish to disable DHCP'
|
|
94
|
+
|
|
95
|
+
option :lan,
|
|
96
|
+
short: '-L ID',
|
|
97
|
+
long: '--lan ID',
|
|
98
|
+
description: 'The LAN ID the NIC will reside on; if the LAN ID does not exist it will be created',
|
|
99
|
+
required: true
|
|
100
|
+
|
|
101
|
+
def run
|
|
102
|
+
$stdout.sync = true
|
|
103
|
+
|
|
104
|
+
print "#{ui.color('Creating composite server...', :magenta)}"
|
|
105
|
+
volume_params = {
|
|
106
|
+
name: config[:volumename],
|
|
107
|
+
size: config[:size],
|
|
108
|
+
bus: config[:bus] || 'VIRTIO',
|
|
109
|
+
image: config[:image],
|
|
110
|
+
type: config[:type],
|
|
111
|
+
licenceType: config[:licencetype],
|
|
112
|
+
sshKeys: config[:sshkeys]
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
nic_params = {
|
|
116
|
+
name: config[:nicname],
|
|
117
|
+
ips: config[:ips],
|
|
118
|
+
dhcp: config[:dhcp],
|
|
119
|
+
lan: config[:lan]
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
params = {
|
|
123
|
+
name: config[:name],
|
|
124
|
+
cores: config[:cores],
|
|
125
|
+
ram: config[:ram],
|
|
126
|
+
availabilityZone: config[:availabilityzone],
|
|
127
|
+
volumes: [volume_params],
|
|
128
|
+
nics: [nic_params]
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
connection
|
|
132
|
+
server = ProfitBricks::Server.create(
|
|
133
|
+
config[:datacenter_id],
|
|
134
|
+
params.compact
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
dot = ui.color('.', :magenta)
|
|
138
|
+
server.wait_for(300) { print dot; ready? }
|
|
139
|
+
server.reload
|
|
140
|
+
|
|
141
|
+
puts "\n"
|
|
142
|
+
puts "#{ui.color('ID', :cyan)}: #{server.id}"
|
|
143
|
+
puts "#{ui.color('Name', :cyan)}: #{server.properties['name']}"
|
|
144
|
+
puts "#{ui.color('Cores', :cyan)}: #{server.properties['cores']}"
|
|
145
|
+
puts "#{ui.color('Ram', :cyan)}: #{server.properties['ram']}"
|
|
146
|
+
puts "#{ui.color('Availability Zone', :cyan)}: #{server.properties['availabilityZone']}"
|
|
147
|
+
|
|
148
|
+
puts 'done'
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
@@ -10,7 +10,8 @@ class Chef
|
|
|
10
10
|
option :name,
|
|
11
11
|
short: '-n NAME',
|
|
12
12
|
long: '--name NAME',
|
|
13
|
-
description: 'Name of the data center'
|
|
13
|
+
description: 'Name of the data center',
|
|
14
|
+
required: true
|
|
14
15
|
|
|
15
16
|
option :description,
|
|
16
17
|
short: '-D DESCRIPTION',
|
|
@@ -21,7 +22,8 @@ class Chef
|
|
|
21
22
|
short: '-l LOCATION',
|
|
22
23
|
long: '--location LOCATION',
|
|
23
24
|
description: 'Location of the data center',
|
|
24
|
-
proc: proc { |location| Chef::Config[:knife][:location] = location }
|
|
25
|
+
proc: proc { |location| Chef::Config[:knife][:location] = location },
|
|
26
|
+
required: true
|
|
25
27
|
|
|
26
28
|
def run
|
|
27
29
|
$stdout.sync = true
|
|
@@ -11,17 +11,20 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'The UUID of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :server_id,
|
|
17
18
|
short: '-S SERVER_UUID',
|
|
18
19
|
long: '--server-id SERVER_UUID',
|
|
19
|
-
description: 'The UUID of the server'
|
|
20
|
+
description: 'The UUID of the server',
|
|
21
|
+
required: true
|
|
20
22
|
|
|
21
23
|
option :nic_id,
|
|
22
24
|
short: '-N NIC_UUID',
|
|
23
25
|
long: '--nic-id NIC_UUID',
|
|
24
|
-
description: 'UUID of the NIC'
|
|
26
|
+
description: 'UUID of the NIC',
|
|
27
|
+
required: true
|
|
25
28
|
|
|
26
29
|
def run
|
|
27
30
|
connection
|
|
@@ -11,17 +11,20 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'UUID of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :server_id,
|
|
17
18
|
short: '-S SERVER_UUID',
|
|
18
19
|
long: '--server-id SERVER_UUID',
|
|
19
|
-
description: 'The UUID of the server'
|
|
20
|
+
description: 'The UUID of the server',
|
|
21
|
+
required: true
|
|
20
22
|
|
|
21
23
|
option :nic_id,
|
|
22
24
|
short: '-N NIC_UUID',
|
|
23
25
|
long: '--nic-id NIC_UUID',
|
|
24
|
-
description: 'UUID of the NIC'
|
|
26
|
+
description: 'UUID of the NIC',
|
|
27
|
+
required: true
|
|
25
28
|
|
|
26
29
|
def run
|
|
27
30
|
$stdout.sync = true
|
|
@@ -10,12 +10,14 @@ class Chef
|
|
|
10
10
|
option :location,
|
|
11
11
|
short: '-l LOCATION',
|
|
12
12
|
long: '--location LOCATION',
|
|
13
|
-
description: 'Location of the IP block (us/las, de/fra, de/fkb)'
|
|
13
|
+
description: 'Location of the IP block (us/las, de/fra, de/fkb)',
|
|
14
|
+
required: true
|
|
14
15
|
|
|
15
16
|
option :size,
|
|
16
17
|
short: '-S INT',
|
|
17
18
|
long: '--size INT',
|
|
18
|
-
description: 'The number of IP addresses to reserve'
|
|
19
|
+
description: 'The number of IP addresses to reserve',
|
|
20
|
+
required: true
|
|
19
21
|
|
|
20
22
|
def run
|
|
21
23
|
$stdout.sync = true
|
|
@@ -11,7 +11,8 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'Name of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :name,
|
|
17
18
|
short: '-n NAME',
|
|
@@ -11,7 +11,8 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'Name of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
def run
|
|
17
18
|
connection
|
|
@@ -11,7 +11,8 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'The UUID of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
def run
|
|
17
18
|
$stdout.sync = true
|
|
@@ -11,12 +11,14 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'Name of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :server_id,
|
|
17
18
|
short: '-S SERVER_UUID',
|
|
18
19
|
long: '--server-id SERVER_UUID',
|
|
19
|
-
description: 'Name of the server'
|
|
20
|
+
description: 'Name of the server',
|
|
21
|
+
required: true
|
|
20
22
|
|
|
21
23
|
option :name,
|
|
22
24
|
short: '-n NAME',
|
|
@@ -39,7 +41,8 @@ class Chef
|
|
|
39
41
|
option :lan,
|
|
40
42
|
short: '-l ID',
|
|
41
43
|
long: '--lan ID',
|
|
42
|
-
description: 'The LAN ID the NIC will reside on; if the LAN ID does not exist it will be created'
|
|
44
|
+
description: 'The LAN ID the NIC will reside on; if the LAN ID does not exist it will be created',
|
|
45
|
+
required: true
|
|
43
46
|
|
|
44
47
|
def run
|
|
45
48
|
$stdout.sync = true
|
|
@@ -11,12 +11,14 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'The UUID of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :server_id,
|
|
17
18
|
short: '-S SERVER_UUID',
|
|
18
19
|
long: '--server-id SERVER_UUID',
|
|
19
|
-
description: 'The UUID of the server assigned the NIC'
|
|
20
|
+
description: 'The UUID of the server assigned the NIC',
|
|
21
|
+
required: true
|
|
20
22
|
|
|
21
23
|
def run
|
|
22
24
|
connection
|
|
@@ -11,12 +11,14 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'The UUID of the datacenter containing the NIC',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :server_id,
|
|
17
18
|
short: '-S SERVER_UUID',
|
|
18
19
|
long: '--server-id SERVER_UUID',
|
|
19
|
-
description: 'The UUID of the server assigned the NIC'
|
|
20
|
+
description: 'The UUID of the server assigned the NIC',
|
|
21
|
+
required: true
|
|
20
22
|
|
|
21
23
|
def run
|
|
22
24
|
$stdout.sync = true
|
|
@@ -11,22 +11,26 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'Name of the virtual datacenter',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :name,
|
|
17
18
|
short: '-n NAME',
|
|
18
19
|
long: '--name NAME',
|
|
19
|
-
description: 'Name of the server'
|
|
20
|
+
description: 'Name of the server',
|
|
21
|
+
required: true
|
|
20
22
|
|
|
21
23
|
option :cores,
|
|
22
24
|
short: '-C CORES',
|
|
23
25
|
long: '--cores CORES',
|
|
24
|
-
description: 'The number of processor cores'
|
|
26
|
+
description: 'The number of processor cores',
|
|
27
|
+
required: true
|
|
25
28
|
|
|
26
29
|
option :ram,
|
|
27
30
|
short: '-r RAM',
|
|
28
31
|
long: '--ram RAM',
|
|
29
|
-
description: 'The amount of RAM in MB'
|
|
32
|
+
description: 'The amount of RAM in MB',
|
|
33
|
+
required: true
|
|
30
34
|
|
|
31
35
|
option :availabilityzone,
|
|
32
36
|
short: '-a AVAILABILITY_ZONE',
|
|
@@ -11,7 +11,8 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'Name of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
def run
|
|
17
18
|
connection
|
|
@@ -11,7 +11,8 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'The UUID of the datacenter containing the server',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
def run
|
|
17
18
|
$stdout.sync = true
|
|
@@ -11,7 +11,8 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'UUID of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
def run
|
|
17
18
|
connection
|
|
@@ -11,7 +11,8 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'UUID of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
def run
|
|
17
18
|
connection
|
|
@@ -11,7 +11,8 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'UUID of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
def run
|
|
17
18
|
connection
|
|
@@ -11,12 +11,14 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'The UUID of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :server_id,
|
|
17
18
|
short: '-S SERVER_UUID',
|
|
18
19
|
long: '--server-id SERVER_UUID',
|
|
19
|
-
description: 'The UUID of the server'
|
|
20
|
+
description: 'The UUID of the server',
|
|
21
|
+
required: true
|
|
20
22
|
|
|
21
23
|
def run
|
|
22
24
|
connection
|
|
@@ -11,7 +11,8 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'Name of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :name,
|
|
17
18
|
short: '-n NAME',
|
|
@@ -21,7 +22,8 @@ class Chef
|
|
|
21
22
|
option :size,
|
|
22
23
|
short: '-S SIZE',
|
|
23
24
|
long: '--size SIZE',
|
|
24
|
-
description: 'The size of the volume in GB'
|
|
25
|
+
description: 'The size of the volume in GB',
|
|
26
|
+
required: true
|
|
25
27
|
|
|
26
28
|
option :bus,
|
|
27
29
|
short: '-b BUS',
|
|
@@ -36,13 +38,20 @@ class Chef
|
|
|
36
38
|
option :type,
|
|
37
39
|
short: '-t TYPE',
|
|
38
40
|
long: '--type TYPE',
|
|
39
|
-
description: 'The disk type; currently only HDD.'
|
|
41
|
+
description: 'The disk type; currently only HDD.',
|
|
42
|
+
required: true
|
|
40
43
|
|
|
41
44
|
option :licencetype,
|
|
42
45
|
short: '-l LICENCE',
|
|
43
46
|
long: '--licence-type LICENCE',
|
|
44
47
|
description: 'The licence type of the volume (LINUX, WINDOWS, UNKNOWN, OTHER)'
|
|
45
48
|
|
|
49
|
+
option :sshkeys,
|
|
50
|
+
short: '-K SSHKEY[,SSHKEY,...]',
|
|
51
|
+
long: '--ssh-keys SSHKEY1,SSHKEY2,...',
|
|
52
|
+
description: 'A list of public SSH keys to include',
|
|
53
|
+
proc: proc { |sshkeys| sshkeys.split(',') }
|
|
54
|
+
|
|
46
55
|
def run
|
|
47
56
|
$stdout.sync = true
|
|
48
57
|
|
|
@@ -54,7 +63,8 @@ class Chef
|
|
|
54
63
|
bus: config[:bus] || 'VIRTIO',
|
|
55
64
|
image: config[:image],
|
|
56
65
|
type: config[:type],
|
|
57
|
-
licenceType: config[:licencetype]
|
|
66
|
+
licenceType: config[:licencetype],
|
|
67
|
+
sshKeys: config[:sshkeys]
|
|
58
68
|
}
|
|
59
69
|
|
|
60
70
|
connection
|
|
@@ -64,7 +74,7 @@ class Chef
|
|
|
64
74
|
)
|
|
65
75
|
|
|
66
76
|
dot = ui.color('.', :magenta)
|
|
67
|
-
volume.wait_for { print dot; ready? }
|
|
77
|
+
volume.wait_for(300) { print dot; ready? }
|
|
68
78
|
volume.reload
|
|
69
79
|
|
|
70
80
|
puts "\n"
|
|
@@ -11,7 +11,8 @@ class Chef
|
|
|
11
11
|
short: '-D UUID',
|
|
12
12
|
long: '--datacenter-id UUID',
|
|
13
13
|
description: 'Name of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
def run
|
|
17
18
|
connection
|
|
@@ -11,12 +11,14 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'The UUID of the data center',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :server_id,
|
|
17
18
|
short: '-S SERVER_UUID',
|
|
18
19
|
long: '--server-id SERVER_UUID',
|
|
19
|
-
description: 'The UUID of the server'
|
|
20
|
+
description: 'The UUID of the server',
|
|
21
|
+
required: true
|
|
20
22
|
|
|
21
23
|
def run
|
|
22
24
|
connection
|
|
@@ -11,12 +11,14 @@ class Chef
|
|
|
11
11
|
short: '-D DATACENTER_UUID',
|
|
12
12
|
long: '--datacenter-id DATACENTER_UUID',
|
|
13
13
|
description: 'The UUID of the virtul data center containing the volume',
|
|
14
|
-
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id }
|
|
14
|
+
proc: proc { |datacenter_id| Chef::Config[:knife][:datacenter_id] = datacenter_id },
|
|
15
|
+
required: true
|
|
15
16
|
|
|
16
17
|
option :server_id,
|
|
17
18
|
short: '-S SERVER_UUID',
|
|
18
19
|
long: '--server-id SERVER_UUID',
|
|
19
|
-
description: 'The UUID of the server'
|
|
20
|
+
description: 'The UUID of the server',
|
|
21
|
+
required: true
|
|
20
22
|
|
|
21
23
|
def run
|
|
22
24
|
$stdout.sync = true
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: knife-profitbricks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ethan Devenport
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: profitbricks-sdk-ruby
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ~>
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.
|
|
19
|
+
version: '1.1'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ~>
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.
|
|
26
|
+
version: '1.1'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: chef
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -94,6 +94,7 @@ files:
|
|
|
94
94
|
- Rakefile
|
|
95
95
|
- knife-profitbricks.gemspec
|
|
96
96
|
- lib/chef/knife/profitbricks_base.rb
|
|
97
|
+
- lib/chef/knife/profitbricks_composite_server_create.rb
|
|
97
98
|
- lib/chef/knife/profitbricks_datacenter_create.rb
|
|
98
99
|
- lib/chef/knife/profitbricks_datacenter_delete.rb
|
|
99
100
|
- lib/chef/knife/profitbricks_datacenter_list.rb
|
|
@@ -146,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
146
147
|
version: '0'
|
|
147
148
|
requirements: []
|
|
148
149
|
rubyforge_project:
|
|
149
|
-
rubygems_version: 2.
|
|
150
|
+
rubygems_version: 2.0.14
|
|
150
151
|
signing_key:
|
|
151
152
|
specification_version: 4
|
|
152
153
|
summary: Chef Knife plugin for ProfitBricks platform
|
|
@@ -154,4 +155,3 @@ test_files:
|
|
|
154
155
|
- spec/chef/knife/profitbricks_datacenter_list_spec.rb
|
|
155
156
|
- spec/spec_helper.rb
|
|
156
157
|
- spec/test.sh
|
|
157
|
-
has_rdoc:
|