knife-profitbricks 1.1.2 → 1.2.0
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/knife-profitbricks.gemspec +1 -1
- data/lib/chef/knife/profitbricks_composite_server_create.rb +19 -0
- data/lib/chef/knife/profitbricks_nic_create.rb +11 -0
- data/lib/chef/knife/profitbricks_nic_list.rb +3 -1
- data/lib/chef/knife/profitbricks_volume_create.rb +11 -0
- data/lib/chef/knife/profitbricks_volume_list.rb +5 -2
- data/lib/knife-profitbricks/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4728fcd8307f5d8d3c99c35359510c6375ecbf17
|
|
4
|
+
data.tar.gz: ea5d5c7fbffa535126c1bd9ef6a27fcf1899c56e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b621da0104fe0428693403e77842a27e22239cd5452c4028d9fc64137c7e73343e62a4af36e219aec6a2439fa01f2fac93cfee375ac212fad4b84966fbd9533c
|
|
7
|
+
data.tar.gz: 1ca58101f3b618e6b1689dbe5f8325c35b905595283830be32820194fcb73edd4597ec8ac59526b9e215c42595b2afb8780845dc678cf87f307f3b3c195d0860
|
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", "~>
|
|
21
|
+
spec.add_runtime_dependency "profitbricks-sdk-ruby", "~> 3.0"
|
|
22
22
|
spec.add_runtime_dependency "chef", "~> 12"
|
|
23
23
|
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.6"
|
|
@@ -80,6 +80,12 @@ class Chef
|
|
|
80
80
|
long: '--image-password PASSWORD',
|
|
81
81
|
description: 'The password set on the image for the "root" or "Administrator" user'
|
|
82
82
|
|
|
83
|
+
option :volume_availability_zone,
|
|
84
|
+
short: '-Z AVAILABILITY_ZONE',
|
|
85
|
+
long: '--volume-availability-zone AVAILABILITY_ZONE',
|
|
86
|
+
description: 'The volume availability zone of the server',
|
|
87
|
+
required: false
|
|
88
|
+
|
|
83
89
|
option :sshkeys,
|
|
84
90
|
short: '-K SSHKEY[,SSHKEY,...]',
|
|
85
91
|
long: '--ssh-keys SSHKEY1,SSHKEY2,...',
|
|
@@ -109,6 +115,11 @@ class Chef
|
|
|
109
115
|
description: 'The LAN ID the NIC will reside on; if the LAN ID does not exist it will be created',
|
|
110
116
|
required: true
|
|
111
117
|
|
|
118
|
+
option :nat,
|
|
119
|
+
long: '--nat',
|
|
120
|
+
description: 'Set to enable NAT on the NIC',
|
|
121
|
+
required: false
|
|
122
|
+
|
|
112
123
|
def run
|
|
113
124
|
$stdout.sync = true
|
|
114
125
|
|
|
@@ -130,6 +141,10 @@ class Chef
|
|
|
130
141
|
volume_params[:imagePassword] = config[:imagepassword]
|
|
131
142
|
end
|
|
132
143
|
|
|
144
|
+
if config[:volume_availability_zone]
|
|
145
|
+
volume_params[:availabilityZone] = config[:volume_availability_zone]
|
|
146
|
+
end
|
|
147
|
+
|
|
133
148
|
nic_params = {
|
|
134
149
|
name: config[:nicname],
|
|
135
150
|
ips: config[:ips],
|
|
@@ -137,6 +152,10 @@ class Chef
|
|
|
137
152
|
lan: config[:lan]
|
|
138
153
|
}
|
|
139
154
|
|
|
155
|
+
if config[:nat]
|
|
156
|
+
nic_params[:nat] = config[:nat]
|
|
157
|
+
end
|
|
158
|
+
|
|
140
159
|
params = {
|
|
141
160
|
name: config[:name],
|
|
142
161
|
cores: config[:cores],
|
|
@@ -44,6 +44,12 @@ class Chef
|
|
|
44
44
|
description: 'The LAN ID the NIC will reside on; if the LAN ID does not exist it will be created',
|
|
45
45
|
required: true
|
|
46
46
|
|
|
47
|
+
option :nat,
|
|
48
|
+
long: '--nat',
|
|
49
|
+
boolean: true | false,
|
|
50
|
+
description: 'Set to enable NAT on the NIC',
|
|
51
|
+
required: false
|
|
52
|
+
|
|
47
53
|
def run
|
|
48
54
|
$stdout.sync = true
|
|
49
55
|
|
|
@@ -56,6 +62,10 @@ class Chef
|
|
|
56
62
|
lan: config[:lan]
|
|
57
63
|
}
|
|
58
64
|
|
|
65
|
+
if config[:nat]
|
|
66
|
+
params[:nat] = config[:nat]
|
|
67
|
+
end
|
|
68
|
+
|
|
59
69
|
connection
|
|
60
70
|
nic = ProfitBricks::NIC.create(
|
|
61
71
|
config[:datacenter_id],
|
|
@@ -73,6 +83,7 @@ class Chef
|
|
|
73
83
|
puts "#{ui.color('IPs', :cyan)}: #{nic.properties['ips']}"
|
|
74
84
|
puts "#{ui.color('DHCP', :cyan)}: #{nic.properties['dhcp']}"
|
|
75
85
|
puts "#{ui.color('LAN', :cyan)}: #{nic.properties['lan']}"
|
|
86
|
+
puts "#{ui.color('NAT', :cyan)}: #{nic.properties['nat']}"
|
|
76
87
|
|
|
77
88
|
puts 'done'
|
|
78
89
|
end
|
|
@@ -27,6 +27,7 @@ class Chef
|
|
|
27
27
|
ui.color('Name', :bold),
|
|
28
28
|
ui.color('IPs', :bold),
|
|
29
29
|
ui.color('DHCP', :bold),
|
|
30
|
+
ui.color('NAT', :bold),
|
|
30
31
|
ui.color('LAN', :bold)
|
|
31
32
|
]
|
|
32
33
|
connection
|
|
@@ -36,10 +37,11 @@ class Chef
|
|
|
36
37
|
nic_list << nic.properties['name']
|
|
37
38
|
nic_list << nic.properties['ips'].to_s
|
|
38
39
|
nic_list << nic.properties['dhcp'].to_s
|
|
40
|
+
nic_list << nic.properties['nat'].to_s
|
|
39
41
|
nic_list << nic.properties['lan'].to_s
|
|
40
42
|
end
|
|
41
43
|
|
|
42
|
-
puts ui.list(nic_list, :uneven_columns_across,
|
|
44
|
+
puts ui.list(nic_list, :uneven_columns_across, 6)
|
|
43
45
|
end
|
|
44
46
|
end
|
|
45
47
|
end
|
|
@@ -57,6 +57,12 @@ class Chef
|
|
|
57
57
|
description: 'A list of public SSH keys to include',
|
|
58
58
|
proc: proc { |sshkeys| sshkeys.split(',') }
|
|
59
59
|
|
|
60
|
+
option :volume_availability_zone,
|
|
61
|
+
short: '-Z AVAILABILITY_ZONE',
|
|
62
|
+
long: '--availability-zone AVAILABILITY_ZONE',
|
|
63
|
+
description: 'The volume availability zone of the server',
|
|
64
|
+
required: false
|
|
65
|
+
|
|
60
66
|
def run
|
|
61
67
|
$stdout.sync = true
|
|
62
68
|
|
|
@@ -79,6 +85,10 @@ class Chef
|
|
|
79
85
|
params[:imagePassword] = config[:imagepassword]
|
|
80
86
|
end
|
|
81
87
|
|
|
88
|
+
if config[:volume_availability_zone]
|
|
89
|
+
params[:availabilityZone] = config[:volume_availability_zone]
|
|
90
|
+
end
|
|
91
|
+
|
|
82
92
|
connection
|
|
83
93
|
volume = ProfitBricks::Volume.create(
|
|
84
94
|
config[:datacenter_id],
|
|
@@ -97,6 +107,7 @@ class Chef
|
|
|
97
107
|
puts "#{ui.color('Image', :cyan)}: #{volume.properties['image']}"
|
|
98
108
|
puts "#{ui.color('Type', :cyan)}: #{volume.properties['type']}"
|
|
99
109
|
puts "#{ui.color('Licence Type', :cyan)}: #{volume.properties['licenceType']}"
|
|
110
|
+
puts "#{ui.color('Zone', :cyan)}: #{volume.properties['availabilityZone']}"
|
|
100
111
|
puts 'done'
|
|
101
112
|
end
|
|
102
113
|
end
|
|
@@ -18,7 +18,7 @@ class Chef
|
|
|
18
18
|
short: '-S SERVER_ID',
|
|
19
19
|
long: '--server-id SERVER_ID',
|
|
20
20
|
description: 'The ID of the server',
|
|
21
|
-
required:
|
|
21
|
+
required: false
|
|
22
22
|
|
|
23
23
|
def run
|
|
24
24
|
$stdout.sync = true
|
|
@@ -29,6 +29,7 @@ class Chef
|
|
|
29
29
|
ui.color('Bus', :bold),
|
|
30
30
|
ui.color('Image', :bold),
|
|
31
31
|
ui.color('Type', :bold),
|
|
32
|
+
ui.color('Zone', :bold),
|
|
32
33
|
ui.color('Device Number', :bold)
|
|
33
34
|
]
|
|
34
35
|
|
|
@@ -42,6 +43,7 @@ class Chef
|
|
|
42
43
|
volume_list << volume.properties['bus']
|
|
43
44
|
volume_list << volume.properties['image']
|
|
44
45
|
volume_list << volume.properties['type']
|
|
46
|
+
volume_list << volume.properties['availabilityZone']
|
|
45
47
|
volume_list << volume.properties['deviceNumber'].to_s
|
|
46
48
|
end
|
|
47
49
|
else
|
|
@@ -52,11 +54,12 @@ class Chef
|
|
|
52
54
|
volume_list << volume.properties['bus']
|
|
53
55
|
volume_list << volume.properties['image']
|
|
54
56
|
volume_list << volume.properties['type']
|
|
57
|
+
volume_list << volume.properties['availabilityZone']
|
|
55
58
|
volume_list << volume.properties['deviceNumber'].to_s
|
|
56
59
|
end
|
|
57
60
|
end
|
|
58
61
|
|
|
59
|
-
puts ui.list(volume_list, :uneven_columns_across,
|
|
62
|
+
puts ui.list(volume_list, :uneven_columns_across, 8)
|
|
60
63
|
end
|
|
61
64
|
end
|
|
62
65
|
end
|
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.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ethan Devenport
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-10-28 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: '
|
|
19
|
+
version: '3.0'
|
|
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: '
|
|
26
|
+
version: '3.0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: chef
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|