knife-google 4.2.14 → 5.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 292eb0dd39c319feaddb9add7bf3500723607605427517a24d4d222835217326
4
- data.tar.gz: 478f6c09f4f131ebf466b9c4336520601235c00d19dd11ee02e4f423146adb64
3
+ metadata.gz: 5acf2d54f40bb7d262441d72b9b9e9da63c9ebb6a43000d0ae9ded373ebd6b35
4
+ data.tar.gz: 3649681e242ad68f5341d840a146da9226061df16056d67585b01467c4545f99
5
5
  SHA512:
6
- metadata.gz: 7b7206307c0d0a60b4846fab5aeb6ea4a6d86c41d11f824b72e16ccd85491f7d7239db345d607ba5f064e8ce6085212393e5b267f941eeba429b293f0209cafd
7
- data.tar.gz: c957c1e0f17d53855e5bdf080804b84d0ab8e0779c88dee435744fa80fbbd3d721487173b67fb69bb7f83fb5ff99340cd6931d313be3b1d8a8f8dcb74b111f23
6
+ metadata.gz: 5d4a0e82aca291a1dc96472f850b135ea4409f682d5edf8e0ca0822d73d433ebdfa4a68369a44d646720aac56a86359f525c8e435d7f9514b9072d70cee4ce46
7
+ data.tar.gz: 168b0c4c5f76ce12aeec1644182d955607ed62d4e33bf292b12d456aefaf8072ba9ad9aca325b36942c8000caf6ca2f6a483928122e34cdfd8a65ac8d451a567
@@ -56,26 +56,32 @@ class Chef::Knife::Cloud
56
56
  IMAGE_ALIAS_MAP = {
57
57
  "centos-6" => { project: "centos-cloud", prefix: "centos-6" },
58
58
  "centos-7" => { project: "centos-cloud", prefix: "centos-7" },
59
+ "centos-8" => { project: "centos-cloud", prefix: "centos-8" },
59
60
  "container-vm" => { project: "google-containers", prefix: "container-vm" },
60
61
  "coreos" => { project: "coreos-cloud", prefix: "coreos-stable" },
61
- "debian-7" => { project: "debian-cloud", prefix: "debian-7-wheezy" },
62
- "debian-7-backports" => { project: "debian-cloud", prefix: "backports-debian-7-wheezy" },
63
- "debian-8" => { project: "debian-cloud", prefix: "debian-8-jessie" },
62
+ "debian-9" => { project: "debian-cloud", prefix: "debian-9" },
63
+ "debian-10" => { project: "debian-cloud", prefix: "debian-10" },
64
64
  "opensuse-13" => { project: "opensuse-cloud", prefix: "opensuse-13" },
65
65
  "rhel-6" => { project: "rhel-cloud", prefix: "rhel-6" },
66
66
  "rhel-7" => { project: "rhel-cloud", prefix: "rhel-7" },
67
- "sles-11" => { project: "suse-cloud", prefix: "sles-11" },
67
+ "rhel-8" => { project: "rhel-cloud", prefix: "rhel-8" },
68
68
  "sles-12" => { project: "suse-cloud", prefix: "sles-12" },
69
- "ubuntu-12-04" => { project: "ubuntu-os-cloud", prefix: "ubuntu-1204-precise" },
70
- "ubuntu-1204-lts" => { project: "ubuntu-os-cloud", prefix: "ubuntu-1204-precise" },
71
- "ubuntu-14-04" => { project: "ubuntu-os-cloud", prefix: "ubuntu-1404-trusty" },
72
- "ubuntu-1404-lts" => { project: "ubuntu-os-cloud", prefix: "ubuntu-1404-trusty" },
73
- "ubuntu-15-04" => { project: "ubuntu-os-cloud", prefix: "ubuntu-1504-vivid" },
74
- "ubuntu-15-10" => { project: "ubuntu-os-cloud", prefix: "ubuntu-1510-wily" },
69
+ "sles-15" => { project: "suse-cloud", prefix: "sles-15" },
75
70
  "ubuntu-16-04" => { project: "ubuntu-os-cloud", prefix: "ubuntu-1604-xenial" },
76
71
  "ubuntu-1604-lts" => { project: "ubuntu-os-cloud", prefix: "ubuntu-1604-xenial" },
72
+ "ubuntu-1804-lts" => { project: "ubuntu-os-cloud", prefix: "ubuntu-1804-bionic" },
73
+ "ubuntu-2004-lts" => { project: "ubuntu-os-cloud", prefix: "ubuntu-2004-focal" },
74
+ "ubuntu-minimal-1604-lts" => { project: "ubuntu-os-cloud", prefix: "ubuntu-minimal-1604-xenial" },
75
+ "ubuntu-minimal-1804-lts" => { project: "ubuntu-os-cloud", prefix: "ubuntu-minimal-1804-bionic" },
77
76
  "windows-2008-r2" => { project: "windows-cloud", prefix: "windows-server-2008-r2" },
78
77
  "windows-2012-r2" => { project: "windows-cloud", prefix: "windows-server-2012-r2" },
78
+ "windows-2012-r2-core" => { project: "windows-cloud", prefix: "windows-server-2012-r2-dc-core" },
79
+ "windows-2016-core" => { project: "windows-cloud", prefix: "windows-server-2016-dc-core" },
80
+ "windows-2016" => { project: "windows-cloud", prefix: "windows-server-2016-dc" },
81
+ "windows-2019-core-for-containers" => { project: "windows-cloud", prefix: "windows-server-2019-dc-core-for-containers" },
82
+ "windows-2019-core" => { project: "windows-cloud", prefix: "windows-server-2019-dc-core" },
83
+ "windows-2019-for-containers" => { project: "windows-cloud", prefix: "windows-server-2019-dc-for-containers" },
84
+ "windows-2019" => { project: "windows-cloud", prefix: "windows-server-2019-dc" },
79
85
  }.freeze
80
86
 
81
87
  PUBLIC_PROJECTS = %w{
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
3
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
4
- # Copyright:: Copyright (c) 2016 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,19 +23,19 @@ class Chef::Knife::Cloud
23
23
 
24
24
  def create_service_instance
25
25
  Chef::Knife::Cloud::GoogleService.new(
26
- project: locate_config_value(:gce_project),
27
- zone: locate_config_value(:gce_zone),
28
- wait_time: locate_config_value(:request_timeout),
29
- refresh_rate: locate_config_value(:request_refresh_rate),
30
- max_pages: locate_config_value(:gce_max_pages),
31
- max_page_size: locate_config_value(:gce_max_page_size)
26
+ project: config[:gce_project],
27
+ zone: config[:gce_zone],
28
+ wait_time: config[:request_timeout],
29
+ refresh_rate: config[:request_refresh_rate],
30
+ max_pages: config[:gce_max_pages],
31
+ max_page_size: config[:gce_max_page_size]
32
32
  )
33
33
  end
34
34
 
35
35
  def check_for_missing_config_values!(*keys)
36
36
  keys_to_check = REQUIRED_KEYS + keys
37
37
 
38
- missing = keys_to_check.select { |x| locate_config_value(x).nil? }
38
+ missing = keys_to_check.select { |x| config[x].nil? }
39
39
 
40
40
  unless missing.empty?
41
41
  message = "The following required parameters are missing: #{missing.join(", ")}"
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # Author:: Paul Rossman (<paulrossman@google.com>)
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: Copyright 2015-2016 Google Inc., Chef Software, Inc.
5
+ # Copyright:: Copyright (c) Chef Software Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -52,16 +52,16 @@ class Chef::Knife::Cloud
52
52
  def validate_params!
53
53
  check_for_missing_config_values!(:gce_zone, :disk_size, :disk_type)
54
54
  raise "Please specify a disk name." unless @name_args.first
55
- raise "Disk size must be between 10 and 10,000" unless valid_disk_size?(locate_config_value(:disk_size))
55
+ raise "Disk size must be between 10 and 10,000" unless valid_disk_size?(config[:disk_size])
56
56
 
57
57
  super
58
58
  end
59
59
 
60
60
  def execute_command
61
61
  name = @name_args.first
62
- size = locate_config_value(:disk_size)
63
- type = locate_config_value(:disk_type)
64
- src = locate_config_value(:disk_source)
62
+ size = config[:disk_size]
63
+ type = config[:disk_type]
64
+ src = config[:disk_source]
65
65
 
66
66
  service.create_disk(name, size, type, src)
67
67
  end
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # Author:: Paul Rossman (<paulrossman@google.com>)
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: Copyright 2015-2016 Google Inc., Chef Software, Inc.
5
+ # Copyright:: Copyright (c) Chef Software Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -172,28 +172,28 @@ class Chef::Knife::Cloud
172
172
 
173
173
  @create_options = {
174
174
  name: instance_name,
175
- image: locate_config_value(:image),
176
- image_project: locate_config_value(:image_project),
177
- network: locate_config_value(:network),
178
- subnet: locate_config_value(:subnet),
179
- public_ip: locate_config_value(:public_ip),
175
+ image: config[:image],
176
+ image_project: config[:image_project],
177
+ network: config[:network],
178
+ subnet: config[:subnet],
179
+ public_ip: config[:public_ip],
180
180
  auto_migrate: auto_migrate?,
181
181
  auto_restart: auto_restart?,
182
182
  preemptible: preemptible?,
183
- boot_disk_autodelete: locate_config_value(:boot_disk_autodelete),
184
- boot_disk_name: locate_config_value(:boot_disk_name),
183
+ boot_disk_autodelete: config[:boot_disk_autodelete],
184
+ boot_disk_name: config[:boot_disk_name],
185
185
  boot_disk_size: boot_disk_size,
186
- boot_disk_ssd: locate_config_value(:boot_disk_ssd),
187
- additional_disks: locate_config_value(:additional_disks),
188
- local_ssd: locate_config_value(:local_ssd),
189
- interface: locate_config_value(:interface),
186
+ boot_disk_ssd: config[:boot_disk_ssd],
187
+ additional_disks: config[:additional_disks],
188
+ local_ssd: config[:local_ssd],
189
+ interface: config[:interface],
190
190
  number_of_local_ssd: number_of_local_ssd,
191
- can_ip_forward: locate_config_value(:can_ip_forward),
192
- machine_type: locate_config_value(:machine_type),
193
- service_account_scopes: locate_config_value(:service_account_scopes),
194
- service_account_name: locate_config_value(:service_account_name),
191
+ can_ip_forward: config[:can_ip_forward],
192
+ machine_type: config[:machine_type],
193
+ service_account_scopes: config[:service_account_scopes],
194
+ service_account_name: config[:service_account_name],
195
195
  metadata: metadata,
196
- tags: locate_config_value(:tags),
196
+ tags: config[:tags],
197
197
  }
198
198
  end
199
199
 
@@ -208,16 +208,16 @@ class Chef::Knife::Cloud
208
208
  raise "You must supply an instance name." if @name_args.first.nil?
209
209
  raise "Boot disk size must be between 10 and 10,000" unless valid_disk_size?(boot_disk_size)
210
210
 
211
- if locate_config_value(:connection_protocol) == "winrm" && locate_config_value(:gce_email).nil?
211
+ if config[:connection_protocol] == "winrm" && config[:gce_email].nil?
212
212
  raise "Please provide your Google Cloud console email address via --gce-email. " \
213
213
  "It is required when resetting passwords on Windows hosts."
214
214
  end
215
215
 
216
- raise "Please provide connection port via --connection-port." unless locate_config_value(:connection_port)
217
- raise "Please provide image os type via --image-os-type." unless locate_config_value(:image_os_type)
216
+ raise "Please provide connection port via --connection-port." unless config[:connection_port]
217
+ raise "Please provide image os type via --image-os-type." unless config[:image_os_type]
218
218
 
219
- ui.warn("Auto-migrate disabled for preemptible instance") if preemptible? && locate_config_value(:auto_migrate)
220
- ui.warn("Auto-restart disabled for preemptible instance") if preemptible? && locate_config_value(:auto_restart)
219
+ ui.warn("Auto-migrate disabled for preemptible instance") if preemptible? && config[:auto_migrate]
220
+ ui.warn("Auto-restart disabled for preemptible instance") if preemptible? && config[:auto_restart]
221
221
 
222
222
  super
223
223
  end
@@ -225,10 +225,10 @@ class Chef::Knife::Cloud
225
225
  def before_bootstrap
226
226
  super
227
227
 
228
- config[:chef_node_name] = locate_config_value(:chef_node_name) ? locate_config_value(:chef_node_name) : instance_name
228
+ config[:chef_node_name] = config[:chef_node_name] ? config[:chef_node_name] : instance_name
229
229
  config[:bootstrap_ip_address] = ip_address_for_bootstrap
230
230
 
231
- if locate_config_value(:image_os_type) == "windows"
231
+ if config[:image_os_type] == "windows"
232
232
  ui.msg("Resetting the Windows login password so the bootstrap can continue...")
233
233
  config[:connection_password] = reset_windows_password
234
234
  end
@@ -245,31 +245,31 @@ class Chef::Knife::Cloud
245
245
  end
246
246
 
247
247
  def project
248
- locate_config_value(:gce_project)
248
+ config[:gce_project]
249
249
  end
250
250
 
251
251
  def zone
252
- locate_config_value(:gce_zone)
252
+ config[:gce_zone]
253
253
  end
254
254
 
255
255
  def email
256
- locate_config_value(:gce_email)
256
+ config[:gce_email]
257
257
  end
258
258
 
259
259
  def preemptible?
260
- locate_config_value(:preemptible)
260
+ config[:preemptible]
261
261
  end
262
262
 
263
263
  def auto_migrate?
264
- preemptible? ? false : locate_config_value(:auto_migrate)
264
+ preemptible? ? false : config[:auto_migrate]
265
265
  end
266
266
 
267
267
  def auto_restart?
268
- preemptible? ? false : locate_config_value(:auto_restart)
268
+ preemptible? ? false : config[:auto_restart]
269
269
  end
270
270
 
271
271
  def ip_address_for_bootstrap
272
- ip = locate_config_value(:use_private_ip) ? private_ip_for(server) : public_ip_for(server)
272
+ ip = config[:use_private_ip] ? private_ip_for(server) : public_ip_for(server)
273
273
 
274
274
  raise "Unable to determine instance IP address for bootstrapping" if ip == "unknown"
275
275
 
@@ -281,18 +281,18 @@ class Chef::Knife::Cloud
281
281
  end
282
282
 
283
283
  def metadata
284
- locate_config_value(:metadata).each_with_object({}) do |item, memo|
284
+ config[:metadata].each_with_object({}) do |item, memo|
285
285
  key, value = item.split("=")
286
286
  memo[key] = value
287
287
  end
288
288
  end
289
289
 
290
290
  def boot_disk_size
291
- locate_config_value(:boot_disk_size).to_i
291
+ config[:boot_disk_size].to_i
292
292
  end
293
293
 
294
294
  def number_of_local_ssd
295
- locate_config_value(:number_of_local_ssd).to_i
295
+ config[:number_of_local_ssd].to_i
296
296
  end
297
297
 
298
298
  def reset_windows_password
@@ -301,7 +301,7 @@ class Chef::Knife::Cloud
301
301
  zone: zone,
302
302
  instance_name: instance_name,
303
303
  email: email,
304
- username: locate_config_value(:connection_user),
304
+ username: config[:connection_user],
305
305
  debug: gcewinpass_debug_mode
306
306
  ).new_password
307
307
  end
@@ -15,7 +15,7 @@
15
15
  #
16
16
  module Knife
17
17
  module Google
18
- VERSION = "4.2.14"
18
+ VERSION = "5.0.5"
19
19
  MAJOR, MINOR, TINY = VERSION.split(".")
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.14
4
+ version: 5.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chiraq Jog
@@ -13,22 +13,36 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2020-05-21 00:00:00.000000000 Z
16
+ date: 2020-07-24 00:00:00.000000000 Z
17
17
  dependencies:
18
+ - !ruby/object:Gem::Dependency
19
+ name: chef
20
+ requirement: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: '15.11'
25
+ type: :runtime
26
+ prerelease: false
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '15.11'
18
32
  - !ruby/object:Gem::Dependency
19
33
  name: knife-cloud
20
34
  requirement: !ruby/object:Gem::Requirement
21
35
  requirements:
22
36
  - - ">="
23
37
  - !ruby/object:Gem::Version
24
- version: 2.0.0
38
+ version: 4.0.0
25
39
  type: :runtime
26
40
  prerelease: false
27
41
  version_requirements: !ruby/object:Gem::Requirement
28
42
  requirements:
29
43
  - - ">="
30
44
  - !ruby/object:Gem::Version
31
- version: 2.0.0
45
+ version: 4.0.0
32
46
  - !ruby/object:Gem::Dependency
33
47
  name: google-api-client
34
48
  requirement: !ruby/object:Gem::Requirement
@@ -38,7 +52,7 @@ dependencies:
38
52
  version: 0.23.9
39
53
  - - "<"
40
54
  - !ruby/object:Gem::Version
41
- version: 0.39.0
55
+ version: 0.43.0
42
56
  type: :runtime
43
57
  prerelease: false
44
58
  version_requirements: !ruby/object:Gem::Requirement
@@ -48,7 +62,7 @@ dependencies:
48
62
  version: 0.23.9
49
63
  - - "<"
50
64
  - !ruby/object:Gem::Version
51
- version: 0.39.0
65
+ version: 0.43.0
52
66
  - !ruby/object:Gem::Dependency
53
67
  name: gcewinpass
54
68
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - ">="
102
116
  - !ruby/object:Gem::Version
103
- version: '2.5'
117
+ version: '2.6'
104
118
  required_rubygems_version: !ruby/object:Gem::Requirement
105
119
  requirements:
106
120
  - - ">="