vagrant-vcloud 0.4.4 → 0.4.6
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 +100 -38
- data/Rakefile +0 -4
- data/lib/vagrant-vcloud/action.rb +33 -9
- data/lib/vagrant-vcloud/action/build_vapp.rb +163 -56
- data/lib/vagrant-vcloud/action/forward_ports.rb +38 -28
- data/lib/vagrant-vcloud/action/handle_nat_port_collisions.rb +28 -2
- data/lib/vagrant-vcloud/action/inventory_check.rb +20 -14
- data/lib/vagrant-vcloud/action/power_off_vapp.rb +3 -1
- data/lib/vagrant-vcloud/action/power_on.rb +36 -9
- data/lib/vagrant-vcloud/action/read_ssh_info.rb +15 -1
- data/lib/vagrant-vcloud/action/shut_down.rb +33 -0
- data/lib/vagrant-vcloud/config.rb +173 -1
- data/lib/vagrant-vcloud/driver/base.rb +0 -0
- data/lib/vagrant-vcloud/driver/meta.rb +0 -0
- data/lib/vagrant-vcloud/driver/version_5_1.rb +480 -148
- data/lib/vagrant-vcloud/errors.rb +6 -0
- data/lib/vagrant-vcloud/model/forwarded_port.rb +28 -4
- data/lib/vagrant-vcloud/util/compile_forwarded_ports.rb +44 -3
- data/lib/vagrant-vcloud/version.rb +1 -1
- data/locales/en.yml +14 -1
- metadata +4 -3
@@ -27,6 +27,12 @@ module VagrantPlugins
|
|
27
27
|
class ComposeVAppError < VCloudError
|
28
28
|
error_key(:compose_vapp_error)
|
29
29
|
end
|
30
|
+
class ModifyVAppError < VCloudError
|
31
|
+
error_key(:modify_vapp_error)
|
32
|
+
end
|
33
|
+
class PoweronVAppError < VCloudError
|
34
|
+
error_key(:poweron_vapp_error)
|
35
|
+
end
|
30
36
|
class InvalidNetSpecification < VCloudError
|
31
37
|
error_key(:invalid_network_specification)
|
32
38
|
end
|
@@ -39,10 +39,33 @@ module VagrantPlugins
|
|
39
39
|
# @return [Integer]
|
40
40
|
attr_reader :host_port
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
# The network name to forward from.
|
43
|
+
#
|
44
|
+
# @return [String]
|
45
|
+
attr_reader :network_name
|
46
|
+
|
47
|
+
# The network name to forward to.
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
attr_reader :edge_network_name
|
51
|
+
|
52
|
+
# The id of the parent network.
|
53
|
+
#
|
54
|
+
# @return [String]
|
55
|
+
attr_reader :edge_network_id
|
56
|
+
|
57
|
+
# The id of the vm nic.
|
58
|
+
#
|
59
|
+
# @return [Integer]
|
60
|
+
attr_reader :vmnic_id
|
61
|
+
|
62
|
+
def initialize(id, host_port, guest_port, network_name, edge_network_id, edge_network_name, options)
|
63
|
+
@id = id
|
64
|
+
@guest_port = guest_port
|
65
|
+
@host_port = host_port
|
66
|
+
@network_name = network_name
|
67
|
+
@edge_network_id = edge_network_id
|
68
|
+
@edge_network_name = edge_network_name
|
46
69
|
|
47
70
|
options ||= {}
|
48
71
|
@auto_correct = false
|
@@ -52,6 +75,7 @@ module VagrantPlugins
|
|
52
75
|
@guest_ip = options[:guest_ip] || nil
|
53
76
|
@host_ip = options[:host_ip] || nil
|
54
77
|
@protocol = options[:protocol] || 'tcp'
|
78
|
+
@vmnic_id = options[:vmnic_id] || 0
|
55
79
|
end
|
56
80
|
|
57
81
|
# This corrects the host port and changes it to the given new port.
|
@@ -8,10 +8,10 @@ module VagrantPlugins
|
|
8
8
|
|
9
9
|
# This method compiles the forwarded ports into {ForwardedPort}
|
10
10
|
# models.
|
11
|
-
def compile_forwarded_ports(
|
11
|
+
def compile_forwarded_ports(machine)
|
12
12
|
mappings = {}
|
13
13
|
|
14
|
-
config.vm.networks.each do |type, options|
|
14
|
+
machine.config.vm.networks.each do |type, options|
|
15
15
|
if type == :forwarded_port
|
16
16
|
guest_port = options[:guest]
|
17
17
|
host_port = options[:host]
|
@@ -21,8 +21,49 @@ module VagrantPlugins
|
|
21
21
|
# skip forwarded rules already found in handle_nat_port_collisions
|
22
22
|
next if options[:already_exists]
|
23
23
|
|
24
|
+
# skip forwarded rules if disabled
|
25
|
+
next if !options[:disabled].nil? && options[:disabled] == true
|
26
|
+
|
24
27
|
mappings[host_port] =
|
25
|
-
Model::ForwardedPort.new(id, host_port, guest_port, options)
|
28
|
+
Model::ForwardedPort.new(id, host_port, guest_port, 'Vagrant-vApp-Net', machine.provider_config.vdc_network_id, machine.provider_config.vdc_network_name, options)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
if !machine.provider_config.nics.nil?
|
32
|
+
machine.provider_config.nics.each do |nic|
|
33
|
+
next if nic[:forwarded_port].nil?
|
34
|
+
nic[:forwarded_port].each do |fp|
|
35
|
+
options = fp
|
36
|
+
|
37
|
+
guest_port = options[:guest]
|
38
|
+
host_port = options[:host]
|
39
|
+
options = scoped_hash_override(options, :vcloud)
|
40
|
+
id = options[:id]
|
41
|
+
|
42
|
+
# skip forwarded rules already found in handle_nat_port_collisions
|
43
|
+
next if options[:already_exists]
|
44
|
+
|
45
|
+
# skip forwarded rules if disabled
|
46
|
+
next if !options[:disabled].nil? && options[:disabled] == true
|
47
|
+
|
48
|
+
# find matching network
|
49
|
+
edge_id = nil
|
50
|
+
edge_name = nil
|
51
|
+
if !machine.provider_config.networks.nil? && !machine.provider_config.networks[:vapp].nil?
|
52
|
+
machine.provider_config.networks[:vapp].each do |net|
|
53
|
+
next if net[:name] != nic[:network]
|
54
|
+
edge_id = net[:parent_network]
|
55
|
+
edge_name = net[:vdc_network_name]
|
56
|
+
break
|
57
|
+
end
|
58
|
+
end
|
59
|
+
if edge_id == nil || edge_name == nil
|
60
|
+
edge_id = machine.provider_config.vdc_network_id
|
61
|
+
edge_name = machine.provider_config.vdc_network_name
|
62
|
+
end
|
63
|
+
|
64
|
+
mappings[host_port] = Model::ForwardedPort.new(id, host_port, guest_port, nic[:network], edge_id, edge_name, options)
|
65
|
+
|
66
|
+
end
|
26
67
|
end
|
27
68
|
end
|
28
69
|
|
data/locales/en.yml
CHANGED
@@ -24,6 +24,7 @@ en:
|
|
24
24
|
template: "Configuration must specify a template name"
|
25
25
|
username: "Configuration must specify a vCloud Director username"
|
26
26
|
vdc_name: "Configuration must specify a vCloud Director Virtual Datacenter (Target Organization VDC)"
|
27
|
+
vdc_network_name: "Configuration must specify a vCloud Director vDC network name"
|
27
28
|
errors:
|
28
29
|
missing_compute_resource: "Configured compute resource not found"
|
29
30
|
missing_datacenter: "Configured data center not found"
|
@@ -35,6 +36,8 @@ en:
|
|
35
36
|
invalid_network_specification: "Wrong Network specification in the Vagrantfile, make sure you have access to the specified network."
|
36
37
|
stop_vapp_error: "Impossible to stop vApp, could be a transient error, please try again, error: %{message}"
|
37
38
|
compose_vapp_error: "Impossible to compose a vApp, error: %{message}"
|
39
|
+
modify_vapp_error: "Unable to modify vApp, error: %{message}"
|
40
|
+
poweron_vapp_error: "Unable to power on vApp, error: %{message}"
|
38
41
|
forward_port_collision: "Port collision detected, change it in the Vagrantfile or add auto_correct: true. %{guest_port} => %{host_port}"
|
39
42
|
rest_errors:
|
40
43
|
object_not_found: "Object not found in vCloud Director"
|
@@ -59,7 +62,17 @@ en:
|
|
59
62
|
|
60
63
|
Host path: %{hostpath}
|
61
64
|
Error: %{err}
|
62
|
-
|
65
|
+
gc:
|
66
|
+
admin_password: "Guest customization must be enabled to generate/specify password"
|
67
|
+
admin_password_gs: "Admin assword must be auto generated or secified"
|
68
|
+
admin_password_reset: "Guest customization must be enabled to require password reset"
|
69
|
+
auto_login: "Allow admin password is required to enable auto login"
|
70
|
+
auto_login_count: "Auto login count must be between 1 and 100"
|
71
|
+
auto_login_count_req: "Auto login count is required, if auto login is enabled"
|
72
|
+
change_sid: "Guest customization must be enabled to change the SID"
|
73
|
+
domain: "Change SID mst be enabled to join to a domain"
|
74
|
+
domain_join: "Joining a domain requires domain name, domain user, and domain password"
|
75
|
+
script: "Guest customization must be enabled to run a script"
|
63
76
|
states:
|
64
77
|
not_created: |-
|
65
78
|
The environment has not yet been created. Run `vagrant up` to
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-vcloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabio Rapposelli
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-12-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
@@ -223,6 +223,7 @@ files:
|
|
223
223
|
- lib/vagrant-vcloud/action/read_ssh_info.rb
|
224
224
|
- lib/vagrant-vcloud/action/read_state.rb
|
225
225
|
- lib/vagrant-vcloud/action/resume.rb
|
226
|
+
- lib/vagrant-vcloud/action/shut_down.rb
|
226
227
|
- lib/vagrant-vcloud/action/suspend.rb
|
227
228
|
- lib/vagrant-vcloud/action/sync_folders.rb
|
228
229
|
- lib/vagrant-vcloud/action/unmap_port_forwardings.rb
|
@@ -263,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
263
264
|
version: '0'
|
264
265
|
requirements: []
|
265
266
|
rubyforge_project:
|
266
|
-
rubygems_version: 2.
|
267
|
+
rubygems_version: 2.5.2
|
267
268
|
signing_key:
|
268
269
|
specification_version: 4
|
269
270
|
summary: VMware vCloud Director® provider
|