knife-vcenter 3.0.0 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/knife/cloud/vcenter_service.rb +1 -1
- data/lib/chef/knife/cloud/vcenter_service_helpers.rb +6 -6
- data/lib/chef/knife/vcenter_cluster_list.rb +6 -3
- data/lib/chef/knife/vcenter_datacenter_list.rb +6 -3
- data/lib/chef/knife/vcenter_host_list.rb +6 -3
- data/lib/chef/knife/vcenter_vm_clone.rb +14 -11
- data/lib/chef/knife/vcenter_vm_create.rb +11 -8
- data/lib/chef/knife/vcenter_vm_delete.rb +6 -3
- data/lib/chef/knife/vcenter_vm_list.rb +7 -4
- data/lib/chef/knife/vcenter_vm_show.rb +7 -3
- data/lib/knife-vcenter/version.rb +1 -1
- metadata +19 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eef4ee6cd63d8088d6ae99d029481fcdeb42a180b0755dc3ca6978f28ede4f3e
|
4
|
+
data.tar.gz: 73b59b285f808822695d23dcf4da81c09a6154b211f7e0f08baa51b0725d7239
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65731ebf6481dc6366b5c25e68ee4e3467726248ce3ff065990c376d5b3c0cef97b2210514ad4e8165af928910b234bd49ac861801306e11d35a1313693e88f5
|
7
|
+
data.tar.gz: 5daa3c3a9d70c099bc269452400e1f5cfe26ac4b62e85d6b7e31b1b954ab96438a3c7d4509e2d25955f9838d1700a19e799a3a4a1b6e57be2ace4b56980ee295
|
@@ -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)
|
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");
|
@@ -31,16 +31,16 @@ class Chef
|
|
31
31
|
# Creates the object for vCenterService
|
32
32
|
#
|
33
33
|
def create_service_instance
|
34
|
-
Chef::Knife::Cloud::VcenterService.new(username:
|
35
|
-
password:
|
36
|
-
host:
|
34
|
+
Chef::Knife::Cloud::VcenterService.new(username: config[:vcenter_username],
|
35
|
+
password: config[:vcenter_password],
|
36
|
+
host: config[:vcenter_host],
|
37
37
|
verify_ssl: verify_ssl?)
|
38
38
|
end
|
39
39
|
|
40
40
|
# Do we have valid SSL?
|
41
41
|
#
|
42
42
|
def verify_ssl?
|
43
|
-
!
|
43
|
+
!config[:vcenter_disable_ssl_verify]
|
44
44
|
end
|
45
45
|
|
46
46
|
# Validate the options and fail out if something isn't there
|
@@ -54,7 +54,7 @@ class Chef
|
|
54
54
|
#
|
55
55
|
# @param [Object] keys makes sure that the values are all not nil
|
56
56
|
def check_for_missing_config_values!(*keys)
|
57
|
-
missing = keys.select { |x|
|
57
|
+
missing = keys.select { |x| config[x].nil? }
|
58
58
|
|
59
59
|
unless missing.empty?
|
60
60
|
ui.error(format("The following required parameters are missing: %s", missing.join(", ")))
|
@@ -19,8 +19,6 @@
|
|
19
19
|
|
20
20
|
require "chef/knife"
|
21
21
|
require "chef/knife/cloud/list_resource_command"
|
22
|
-
require_relative "cloud/vcenter_service"
|
23
|
-
require_relative "cloud/vcenter_service_helpers"
|
24
22
|
require_relative "cloud/vcenter_service_options"
|
25
23
|
|
26
24
|
class Chef
|
@@ -28,11 +26,16 @@ class Chef
|
|
28
26
|
class Cloud
|
29
27
|
# Extends ResourceListcommand to talk to vCenter
|
30
28
|
class VcenterClusterList < ResourceListCommand
|
31
|
-
include VcenterServiceHelpers
|
32
29
|
include VcenterServiceOptions
|
33
30
|
|
34
31
|
banner "knife vcenter cluster list"
|
35
32
|
|
33
|
+
# lazy load this file as it includes vmware deps that we only want at plugin runtime
|
34
|
+
deps do
|
35
|
+
require_relative "cloud/vcenter_service"
|
36
|
+
include VcenterServiceHelpers
|
37
|
+
end
|
38
|
+
|
36
39
|
# Creates the columns and how to sort the columns
|
37
40
|
#
|
38
41
|
def before_exec_command
|
@@ -19,8 +19,6 @@
|
|
19
19
|
|
20
20
|
require "chef/knife"
|
21
21
|
require "chef/knife/cloud/list_resource_command"
|
22
|
-
require_relative "cloud/vcenter_service"
|
23
|
-
require_relative "cloud/vcenter_service_helpers"
|
24
22
|
require_relative "cloud/vcenter_service_options"
|
25
23
|
|
26
24
|
class Chef
|
@@ -30,11 +28,16 @@ class Chef
|
|
30
28
|
class Cloud
|
31
29
|
# Extends the ResourceListCommand for specific vCenter
|
32
30
|
class VcenterDatacenterList < ResourceListCommand
|
33
|
-
include VcenterServiceHelpers
|
34
31
|
include VcenterServiceOptions
|
35
32
|
|
36
33
|
banner "knife vcenter datacenter list"
|
37
34
|
|
35
|
+
# lazy load this file as it includes vmware deps that we only want at plugin runtime
|
36
|
+
deps do
|
37
|
+
require_relative "cloud/vcenter_service"
|
38
|
+
include VcenterServiceHelpers
|
39
|
+
end
|
40
|
+
|
38
41
|
# Sets up the columns for listing out and sorts by name
|
39
42
|
#
|
40
43
|
def before_exec_command
|
@@ -19,8 +19,6 @@
|
|
19
19
|
|
20
20
|
require "chef/knife"
|
21
21
|
require "chef/knife/cloud/list_resource_command"
|
22
|
-
require_relative "cloud/vcenter_service"
|
23
|
-
require_relative "cloud/vcenter_service_helpers"
|
24
22
|
require_relative "cloud/vcenter_service_options"
|
25
23
|
|
26
24
|
class Chef
|
@@ -30,11 +28,16 @@ class Chef
|
|
30
28
|
class Cloud
|
31
29
|
# Extends the ResourceListcommand for specific vCenter
|
32
30
|
class VcenterHostList < ResourceListCommand
|
33
|
-
include VcenterServiceHelpers
|
34
31
|
include VcenterServiceOptions
|
35
32
|
|
36
33
|
banner "knife vcenter host list"
|
37
34
|
|
35
|
+
# lazy load this file as it includes vmware deps that we only want at plugin runtime
|
36
|
+
deps do
|
37
|
+
require_relative "cloud/vcenter_service"
|
38
|
+
include VcenterServiceHelpers
|
39
|
+
end
|
40
|
+
|
38
41
|
# Sets up the columns for listing out and sorts by name
|
39
42
|
#
|
40
43
|
def before_exec_command
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
#
|
4
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
5
|
-
# Copyright:: Copyright (c)
|
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");
|
@@ -21,8 +21,6 @@
|
|
21
21
|
require "chef/knife"
|
22
22
|
require "chef/knife/cloud/server/create_command"
|
23
23
|
require "chef/knife/cloud/server/create_options"
|
24
|
-
require_relative "cloud/vcenter_service"
|
25
|
-
require_relative "cloud/vcenter_service_helpers"
|
26
24
|
require_relative "cloud/vcenter_service_options"
|
27
25
|
|
28
26
|
class Chef
|
@@ -32,12 +30,17 @@ class Chef
|
|
32
30
|
class Cloud
|
33
31
|
# Extends the ServerCreateCommand for specific vCenter
|
34
32
|
class VcenterVmClone < Chef::Knife::Cloud::ServerCreateCommand
|
35
|
-
include VcenterServiceHelpers
|
36
33
|
include VcenterServiceOptions
|
37
34
|
include ServerCreateOptions
|
38
35
|
|
39
36
|
banner "knife vcenter vm clone NAME (options)"
|
40
37
|
|
38
|
+
# lazy load this file as it includes vmware deps that we only want at plugin runtime
|
39
|
+
deps do
|
40
|
+
require_relative "cloud/vcenter_service"
|
41
|
+
include VcenterServiceHelpers
|
42
|
+
end
|
43
|
+
|
41
44
|
option :template,
|
42
45
|
long: "--template NAME",
|
43
46
|
description: "Name of VM or template to use to clone machine from"
|
@@ -87,12 +90,12 @@ class Chef
|
|
87
90
|
@create_options = {
|
88
91
|
name: @name_args[0],
|
89
92
|
type: "clone",
|
90
|
-
template:
|
91
|
-
targethost:
|
92
|
-
datacenter:
|
93
|
-
poweron: !
|
94
|
-
folder:
|
95
|
-
resource_pool:
|
93
|
+
template: config[:template],
|
94
|
+
targethost: config[:targethost],
|
95
|
+
datacenter: config[:datacenter],
|
96
|
+
poweron: !config[:disable_power_on],
|
97
|
+
folder: config[:folder],
|
98
|
+
resource_pool: config[:pool],
|
96
99
|
}
|
97
100
|
end
|
98
101
|
|
@@ -101,7 +104,7 @@ class Chef
|
|
101
104
|
def before_bootstrap
|
102
105
|
super
|
103
106
|
|
104
|
-
config[:chef_node_name] =
|
107
|
+
config[:chef_node_name] = config[:chef_node_name] || server.name
|
105
108
|
|
106
109
|
config[:bootstrap_ip_address] = hostname_for_server
|
107
110
|
end
|
@@ -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)
|
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");
|
@@ -20,8 +20,6 @@
|
|
20
20
|
require "chef/knife"
|
21
21
|
require "chef/knife/cloud/server/create_command"
|
22
22
|
require "chef/knife/cloud/server/create_options"
|
23
|
-
require_relative "cloud/vcenter_service"
|
24
|
-
require_relative "cloud/vcenter_service_helpers"
|
25
23
|
require_relative "cloud/vcenter_service_options"
|
26
24
|
|
27
25
|
class Chef
|
@@ -31,12 +29,17 @@ class Chef
|
|
31
29
|
class Cloud
|
32
30
|
# Extends the ServerCreateCommand for specific vCenter
|
33
31
|
class VcenterVmCreate < Chef::Knife::Cloud::ServerCreateCommand
|
34
|
-
include VcenterServiceHelpers
|
35
32
|
include VcenterServiceOptions
|
36
33
|
include ServerCreateOptions
|
37
34
|
|
38
35
|
banner "knife vcenter vm create NAME"
|
39
36
|
|
37
|
+
# lazy load this file as it includes vmware deps that we only want at plugin runtime
|
38
|
+
deps do
|
39
|
+
require_relative "cloud/vcenter_service"
|
40
|
+
include VcenterServiceHelpers
|
41
|
+
end
|
42
|
+
|
40
43
|
option :targethost,
|
41
44
|
long: "--targethost HOST",
|
42
45
|
description: "vCenter host on which the new VM should be created"
|
@@ -73,10 +76,10 @@ class Chef
|
|
73
76
|
@create_options = {
|
74
77
|
name: @name_args[0],
|
75
78
|
type: "create",
|
76
|
-
targethost:
|
77
|
-
folder:
|
78
|
-
datastore:
|
79
|
-
resource_pool:
|
79
|
+
targethost: config[:targethost],
|
80
|
+
folder: config[:folder],
|
81
|
+
datastore: config[:datastore],
|
82
|
+
resource_pool: config[:resource_pool],
|
80
83
|
}
|
81
84
|
|
82
85
|
puts @create_options
|
@@ -20,8 +20,6 @@
|
|
20
20
|
require "chef/knife"
|
21
21
|
require "chef/knife/cloud/server/delete_options"
|
22
22
|
require "chef/knife/cloud/server/delete_command"
|
23
|
-
require_relative "cloud/vcenter_service"
|
24
|
-
require_relative "cloud/vcenter_service_helpers"
|
25
23
|
require_relative "cloud/vcenter_service_options"
|
26
24
|
|
27
25
|
class Chef
|
@@ -31,10 +29,15 @@ class Chef
|
|
31
29
|
class VcenterVmDelete < ServerDeleteCommand
|
32
30
|
include ServerDeleteOptions
|
33
31
|
include VcenterServiceOptions
|
34
|
-
include VcenterServiceHelpers
|
35
32
|
|
36
33
|
banner "knife vcenter vm delete NAME [NAME] (options)"
|
37
34
|
|
35
|
+
# lazy load this file as it includes vmware deps that we only want at plugin runtime
|
36
|
+
deps do
|
37
|
+
require_relative "cloud/vcenter_service"
|
38
|
+
include VcenterServiceHelpers
|
39
|
+
end
|
40
|
+
|
38
41
|
# rubocop:disable Style/GuardClause
|
39
42
|
# Validates the parameters to make sure we're good.
|
40
43
|
#
|
@@ -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)
|
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");
|
@@ -20,8 +20,6 @@
|
|
20
20
|
require "chef/knife"
|
21
21
|
require "chef/knife/cloud/server/list_command"
|
22
22
|
require "chef/knife/cloud/server/list_options"
|
23
|
-
require_relative "cloud/vcenter_service"
|
24
|
-
require_relative "cloud/vcenter_service_helpers"
|
25
23
|
require_relative "cloud/vcenter_service_options"
|
26
24
|
|
27
25
|
class Chef
|
@@ -31,11 +29,16 @@ class Chef
|
|
31
29
|
class Cloud
|
32
30
|
# Extends the ServerListCommand for specific vCenter
|
33
31
|
class VcenterVmList < Chef::Knife::Cloud::ServerListCommand
|
34
|
-
include VcenterServiceHelpers
|
35
32
|
include VcenterServiceOptions
|
36
33
|
|
37
34
|
banner "knife vcenter vm list"
|
38
35
|
|
36
|
+
# lazy load this file as it includes vmware deps that we only want at plugin runtime
|
37
|
+
deps do
|
38
|
+
require_relative "cloud/vcenter_service"
|
39
|
+
include VcenterServiceHelpers
|
40
|
+
end
|
41
|
+
|
39
42
|
# Sets up the columns for listing out and sorts by name
|
40
43
|
#
|
41
44
|
def before_exec_command
|
@@ -20,8 +20,6 @@
|
|
20
20
|
require "chef/knife"
|
21
21
|
require "chef/knife/cloud/server/show_options"
|
22
22
|
require "chef/knife/cloud/server/show_command"
|
23
|
-
require_relative "cloud/vcenter_service"
|
24
|
-
require_relative "cloud/vcenter_service_helpers"
|
25
23
|
require_relative "cloud/vcenter_service_options"
|
26
24
|
|
27
25
|
class Chef
|
@@ -31,9 +29,15 @@ class Chef
|
|
31
29
|
class VcenterVmShow < ServerShowCommand
|
32
30
|
include ServerShowOptions
|
33
31
|
include VcenterServiceOptions
|
34
|
-
include VcenterServiceHelpers
|
35
32
|
|
36
33
|
banner "knife vcenter vm show NAME (options)"
|
34
|
+
|
35
|
+
# lazy load this file as it includes vmware deps that we only want at plugin runtime
|
36
|
+
deps do
|
37
|
+
require_relative "cloud/vcenter_service"
|
38
|
+
include VcenterServiceHelpers
|
39
|
+
end
|
40
|
+
|
37
41
|
def validate_params!
|
38
42
|
if @name_args.empty?
|
39
43
|
ui.error("You must supply the name of the virtual machine to display.")
|
metadata
CHANGED
@@ -1,35 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-vcenter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Partner Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: chef
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '3.0'
|
19
|
+
version: '15.11'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
30
|
-
|
26
|
+
version: '15.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: knife-cloud
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
31
32
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
33
|
+
version: '4.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.0'
|
33
41
|
- !ruby/object:Gem::Dependency
|
34
42
|
name: rb-readline
|
35
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,20 +72,6 @@ dependencies:
|
|
64
72
|
- - "<"
|
65
73
|
- !ruby/object:Gem::Version
|
66
74
|
version: '3.0'
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: savon
|
69
|
-
requirement: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - "~>"
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: '2.11'
|
74
|
-
type: :runtime
|
75
|
-
prerelease: false
|
76
|
-
version_requirements: !ruby/object:Gem::Requirement
|
77
|
-
requirements:
|
78
|
-
- - "~>"
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '2.11'
|
81
75
|
- !ruby/object:Gem::Dependency
|
82
76
|
name: vsphere-automation-sdk
|
83
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
119
|
requirements:
|
126
120
|
- - ">="
|
127
121
|
- !ruby/object:Gem::Version
|
128
|
-
version: '2.
|
122
|
+
version: '2.6'
|
129
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
124
|
requirements:
|
131
125
|
- - ">="
|