vagrant-zones 0.1.94 → 0.1.97
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/CHANGELOG.md +32 -0
- data/lib/vagrant-zones/action.rb +12 -3
- data/lib/vagrant-zones/command/console.rb +3 -4
- data/lib/vagrant-zones/command/guest_power_controls.rb +3 -4
- data/lib/vagrant-zones/command/zfssnapshot.rb +3 -4
- data/lib/vagrant-zones/command/zone.rb +3 -5
- data/lib/vagrant-zones/driver.rb +24 -34
- data/lib/vagrant-zones/provider.rb +1 -1
- data/lib/vagrant-zones/version.rb +1 -1
- data/vagrant-zones.gemspec +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bc4c0b91b20ad53d95b7d2544e3b6766db2bb65615b5eb0d0e5196d33b7b48d
|
4
|
+
data.tar.gz: 4c134f5570b0e4fca44105f28c91a2b26291862cd5e6358dcab21e40fffadd77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f85d4e203831861888d8359face75ff093ea82702de832b5ade9f10757bbd896bcf60f84b1f8632f766af82415a357a8a82700ef8fa18b17de1fd42f261b3426
|
7
|
+
data.tar.gz: d78d087ce49093fc843a0f1ed4a96d95d9af91451cd8846a76b8e6b02f412b0dabeeed87853ac18f2c6b5e40c7b1e81e57a8aaf5ba26711e4f8be3d3df521bfa
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,37 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.1.97](https://github.com/STARTcloud/vagrant-zones/compare/v0.1.96...v0.1.97) (2024-08-17)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* add destroy confirmation ([f04e30a](https://github.com/STARTcloud/vagrant-zones/commit/f04e30a3d522dd34568fe99ce6199ae771570b4b))
|
9
|
+
* it was there all along ([7355e11](https://github.com/STARTcloud/vagrant-zones/commit/7355e11f15d932c92cf6a678dc574414620992de))
|
10
|
+
* linting - add destroy confirmation ([35786fc](https://github.com/STARTcloud/vagrant-zones/commit/35786fcd404096362211a2a07b44e901b46cc295))
|
11
|
+
* linting - add destroy confirmation ([31d0140](https://github.com/STARTcloud/vagrant-zones/commit/31d0140da06c66100e78fdd9618394d32428130b))
|
12
|
+
* linting - add destroy confirmation ([30e0324](https://github.com/STARTcloud/vagrant-zones/commit/30e0324a1b0865574d3adb95f3cffbe6656bdd05))
|
13
|
+
|
14
|
+
## [0.1.96](https://github.com/STARTcloud/vagrant-zones/compare/v0.1.95...v0.1.96) (2024-08-17)
|
15
|
+
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
* linting ([86dc089](https://github.com/STARTcloud/vagrant-zones/commit/86dc089c8c2b3b1740fb4ef4eb315f2b2e2dd94a))
|
20
|
+
* linting ([04d665d](https://github.com/STARTcloud/vagrant-zones/commit/04d665d09e68473093a31d86e33065d7f0b698ca))
|
21
|
+
|
22
|
+
## [0.1.95](https://github.com/STARTcloud/vagrant-zones/compare/v0.1.94...v0.1.95) (2024-08-17)
|
23
|
+
|
24
|
+
|
25
|
+
### Bug Fixes
|
26
|
+
|
27
|
+
* linting ([d39015c](https://github.com/STARTcloud/vagrant-zones/commit/d39015c0faba337c8b197e9b35e79f4d1549daba))
|
28
|
+
* linting ([14f34e2](https://github.com/STARTcloud/vagrant-zones/commit/14f34e2c4c10e716924de77d2000618ed249b0d0))
|
29
|
+
* linting ([e908e4d](https://github.com/STARTcloud/vagrant-zones/commit/e908e4dce96a872890201cb67fadbd1fa7a69a02))
|
30
|
+
* linting ([d62952d](https://github.com/STARTcloud/vagrant-zones/commit/d62952de42a07b637a95d6433d0a5d9279b74deb))
|
31
|
+
* linting ([1403f3e](https://github.com/STARTcloud/vagrant-zones/commit/1403f3e24ca50c6878de684ec8770c1542c2798f))
|
32
|
+
* linting ([43d7ecd](https://github.com/STARTcloud/vagrant-zones/commit/43d7ecd08425149f1c262a4af83cf447b2ebd5be))
|
33
|
+
* updating vlans ([1749012](https://github.com/STARTcloud/vagrant-zones/commit/1749012ad76ec05c61ba49e66cf389f09531cfb2))
|
34
|
+
|
3
35
|
## [0.1.94](https://github.com/STARTcloud/vagrant-zones/compare/v0.1.93...v0.1.94) (2024-01-09)
|
4
36
|
|
5
37
|
|
data/lib/vagrant-zones/action.rb
CHANGED
@@ -6,7 +6,7 @@ require 'log4r'
|
|
6
6
|
module VagrantPlugins
|
7
7
|
module ProviderZone
|
8
8
|
# Run actions against the machine
|
9
|
-
module Action
|
9
|
+
module Action # rubocop:disable Metrics/ModuleLength
|
10
10
|
include Vagrant::Action::Builtin
|
11
11
|
@logger = Log4r::Logger.new('vagrant_zones::action')
|
12
12
|
|
@@ -116,8 +116,17 @@ module VagrantPlugins
|
|
116
116
|
# This is the action that is primarily responsible for completely freeing the resources of the underlying virtual machine.
|
117
117
|
def self.action_destroy
|
118
118
|
Vagrant::Action::Builder.new.tap do |b|
|
119
|
-
b.use Call, IsCreated do |
|
120
|
-
|
119
|
+
b.use Call, IsCreated do |env1, b2|
|
120
|
+
unless env1[:result]
|
121
|
+
b2.use NotCreated
|
122
|
+
b2.use Call, DestroyConfirm do |env2, b3|
|
123
|
+
b3.use Destroy if env2[:result]
|
124
|
+
end
|
125
|
+
next
|
126
|
+
end
|
127
|
+
b2.use Call, DestroyConfirm do |env2, b3|
|
128
|
+
b3.use Destroy if env2[:result]
|
129
|
+
end
|
121
130
|
end
|
122
131
|
end
|
123
132
|
end
|
@@ -21,7 +21,7 @@ module VagrantPlugins
|
|
21
21
|
require File.expand_path('webvnc_console', __dir__)
|
22
22
|
WebVNCConsole
|
23
23
|
end
|
24
|
-
super
|
24
|
+
super
|
25
25
|
end
|
26
26
|
|
27
27
|
def execute
|
@@ -48,9 +48,8 @@ module VagrantPlugins
|
|
48
48
|
subopts.separator 'Available subcommands:'
|
49
49
|
# Add the available subcommands as separators in order to print them
|
50
50
|
# out as well.
|
51
|
-
keys =
|
52
|
-
|
53
|
-
keys.sort.each do |key|
|
51
|
+
keys = @subcommands.map { |(key, _value)| key.to_s }.sort
|
52
|
+
keys.each do |key|
|
54
53
|
subopts.separator " #{key}"
|
55
54
|
end
|
56
55
|
subopts.separator 'For help on any individual subcommand run `vagrant zone console <subcommand> -h`'
|
@@ -17,7 +17,7 @@ module VagrantPlugins
|
|
17
17
|
require File.expand_path('shutdown_guest', __dir__)
|
18
18
|
ShutdownGuest
|
19
19
|
end
|
20
|
-
super
|
20
|
+
super
|
21
21
|
end
|
22
22
|
|
23
23
|
def execute
|
@@ -42,9 +42,8 @@ module VagrantPlugins
|
|
42
42
|
subopts.separator 'Available subcommands:'
|
43
43
|
# Add the available subcommands as separators in order to print them
|
44
44
|
# out as well.
|
45
|
-
keys =
|
46
|
-
|
47
|
-
keys.sort.each do |key|
|
45
|
+
keys = @subcommands.map { |(key, _value)| key.to_s }.sort
|
46
|
+
keys.each do |key|
|
48
47
|
subopts.separator " #{key}"
|
49
48
|
end
|
50
49
|
subopts.separator ''
|
@@ -25,7 +25,7 @@ module VagrantPlugins
|
|
25
25
|
require File.expand_path('configure_snapshots', __dir__)
|
26
26
|
ConfigureSnapshots
|
27
27
|
end
|
28
|
-
super
|
28
|
+
super
|
29
29
|
end
|
30
30
|
|
31
31
|
def execute
|
@@ -51,9 +51,8 @@ module VagrantPlugins
|
|
51
51
|
subopts.separator 'Available subcommands:'
|
52
52
|
# Add the available subcommands as separators in order to print them
|
53
53
|
# out as well.
|
54
|
-
keys =
|
55
|
-
|
56
|
-
keys.sort.each do |key|
|
54
|
+
keys = @subcommands.map { |(key, _value)| key.to_s }.sort
|
55
|
+
keys.each do |key|
|
57
56
|
subopts.separator " #{key}"
|
58
57
|
end
|
59
58
|
subopts.separator ''
|
@@ -28,7 +28,7 @@ module VagrantPlugins
|
|
28
28
|
require File.expand_path('console', __dir__)
|
29
29
|
Console
|
30
30
|
end
|
31
|
-
super
|
31
|
+
super
|
32
32
|
end
|
33
33
|
|
34
34
|
def execute
|
@@ -54,10 +54,8 @@ module VagrantPlugins
|
|
54
54
|
|
55
55
|
# Add the available subcommands as separators in order to print them
|
56
56
|
# out as well.
|
57
|
-
keys =
|
58
|
-
|
59
|
-
|
60
|
-
keys.sort.each do |key|
|
57
|
+
keys = @subcommands.map { |(key, _value)| key.to_s }.sort
|
58
|
+
keys.each do |key|
|
61
59
|
subopts.separator " #{key}"
|
62
60
|
end
|
63
61
|
|
data/lib/vagrant-zones/driver.rb
CHANGED
@@ -315,7 +315,7 @@ module VagrantPlugins
|
|
315
315
|
## Manage Network Interfaces
|
316
316
|
def network(uii, state)
|
317
317
|
config = @machine.provider_config
|
318
|
-
uii.info(I18n.t('vagrant_zones.creating_networking_interfaces')) if state == 'create'
|
318
|
+
uii.info(I18n.t('vagrant_zones.creating_networking_interfaces')) if state == 'create' && !config.on_demand_vnics
|
319
319
|
@machine.config.vm.networks.each do |adaptertype, opts|
|
320
320
|
case adaptertype.to_s
|
321
321
|
when 'public_network'
|
@@ -625,16 +625,16 @@ module VagrantPlugins
|
|
625
625
|
vnic_name = vname(uii, opts)
|
626
626
|
uii.info(I18n.t('vagrant_zones.nat_vnic_setup'))
|
627
627
|
uii.info(" #{vnic_name}")
|
628
|
-
|
628
|
+
zonecfg_cmd = "#{@pfexec} zonecfg -z #{@machine.name} "
|
629
629
|
cie = config.cloud_init_enabled
|
630
630
|
case config.brand
|
631
631
|
when 'lx'
|
632
632
|
shrtstr1 = %(set allowed-address=#{allowed_address}; add property (name=gateway,value="#{defrouter}"); )
|
633
633
|
shrtstr2 = %(add property (name=ips,value="#{allowed_address}"); add property (name=primary,value="true"); end;)
|
634
|
-
execute(false, %(#{
|
634
|
+
execute(false, %(#{zonecfg_cmd}set global-nic=auto; #{shrtstr1} #{shrtstr2}"))
|
635
635
|
when 'bhyve'
|
636
|
-
execute(false, %(#{
|
637
|
-
execute(false, %(#{
|
636
|
+
execute(false, %(#{zonecfg_cmd}"add net; set physical=#{vnic_name}; end;")) unless cie
|
637
|
+
execute(false, %(#{zonecfg_cmd}"add net; set physical=#{vnic_name}; set allowed-address=#{allowed_address}; end;")) if cie
|
638
638
|
end
|
639
639
|
end
|
640
640
|
|
@@ -724,16 +724,12 @@ module VagrantPlugins
|
|
724
724
|
def zoneniccreate(uii, opts)
|
725
725
|
mac = macaddress(uii, opts)
|
726
726
|
vnic_name = vname(uii, opts)
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
uii.info(I18n.t('vagrant_zones.creating_vnic'))
|
734
|
-
uii.info(" #{vnic_name}")
|
735
|
-
execute(false, "#{@pfexec} dladm create-vnic -l #{opts[:bridge]} -m #{mac} -v #{vlan} #{vnic_name}")
|
736
|
-
end
|
727
|
+
uii.info(I18n.t('vagrant_zones.creating_vnic'))
|
728
|
+
uii.info(" #{vnic_name}")
|
729
|
+
command = "#{@pfexec} dladm create-vnic -l #{opts[:bridge]} -m #{mac}"
|
730
|
+
command += " -v #{opts[:vlan]}" unless opts[:vlan].nil? || (opts[:vlan]).zero?
|
731
|
+
command += " #{vnic_name}"
|
732
|
+
execute(false, command)
|
737
733
|
end
|
738
734
|
|
739
735
|
# This helps us create all the datasets for the zone
|
@@ -1029,10 +1025,8 @@ module VagrantPlugins
|
|
1029
1025
|
execute(false, %(#{zcfg}"add attr; set name=password; set value=#{ccip}; set type=string; end;")) unless ccip.nil?
|
1030
1026
|
|
1031
1027
|
cclir = config.dns
|
1032
|
-
dservers = []
|
1033
|
-
|
1034
|
-
dservers.append(ns['nameserver'])
|
1035
|
-
end
|
1028
|
+
dservers = cclir['dns'].map { |ns| ns['nameserver'] }
|
1029
|
+
|
1036
1030
|
uii.info(I18n.t('vagrant_zones.setting_cloud_resolvers')) unless dservers.nil?
|
1037
1031
|
uii.info(" #{dservers}") unless dservers.nil?
|
1038
1032
|
execute(false, %(#{zcfg}"add attr; set name=resolvers; set value=#{dservers}; set type=string; end;")) unless dservers.nil?
|
@@ -1051,28 +1045,24 @@ module VagrantPlugins
|
|
1051
1045
|
config = @machine.provider_config
|
1052
1046
|
uii.info(I18n.t('vagrant_zones.vnic_setup'))
|
1053
1047
|
uii.info(" #{vnic_name}")
|
1054
|
-
|
1048
|
+
zonecfg_cmd = "#{@pfexec} zonecfg -z #{@machine.name} "
|
1055
1049
|
cie = config.cloud_init_enabled
|
1056
1050
|
aa = config.allowed_address
|
1057
1051
|
case config.brand
|
1058
1052
|
when 'lx'
|
1059
1053
|
shrtstr1 = %(set allowed-address=#{allowed_address}; add property (name=gateway,value="#{defrouter}"); )
|
1060
1054
|
shrtstr2 = %(add property (name=ips,value="#{allowed_address}"); add property (name=primary,value="true"); end;)
|
1061
|
-
execute(false, %(#{
|
1055
|
+
execute(false, %(#{zonecfg_cmd}set global-nic=auto; #{shrtstr1} #{shrtstr2}"))
|
1062
1056
|
when 'bhyve'
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
execute(false, %(#{strt}"add net; set physical=#{vnic_name}; end;")) unless cie
|
1073
|
-
execute(false, %(#{strt}"add net; set physical=#{vnic_name}; set allowed-address=#{allowed_address}; end;")) if cie && aa
|
1074
|
-
execute(false, %(#{strt}"add net; set physical=#{vnic_name}; end;")) if cie && !aa
|
1075
|
-
end
|
1057
|
+
vlan_option = opts[:vlan].nil? || opts[:vlan].zero? ? '' : "set vlan-id=#{opts[:vlan]}; "
|
1058
|
+
base_cmd = if config.on_demand_vnics
|
1059
|
+
%(#{zonecfg_cmd}"add net; set physical=#{vnic_name}; #{vlan_option}set global-nic=#{opts[:bridge]}; )
|
1060
|
+
else
|
1061
|
+
%(#{zonecfg_cmd}"add net; set physical=#{vnic_name}; )
|
1062
|
+
end
|
1063
|
+
execute(false, %(#{base_cmd}end;)) unless cie
|
1064
|
+
execute(false, %(#{base_cmd}set allowed-address=#{allowed_address}; end;)) if cie && aa
|
1065
|
+
execute(false, %(#{base_cmd}end;)) if cie && !aa
|
1076
1066
|
end
|
1077
1067
|
end
|
1078
1068
|
|
data/vagrant-zones.gemspec
CHANGED
@@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.required_ruby_version = '>= 2.7.0'
|
31
31
|
spec.required_rubygems_version = '>= 1.3.6'
|
32
|
-
spec.
|
33
|
-
spec.
|
34
|
-
spec.
|
35
|
-
spec.
|
36
|
-
spec.
|
32
|
+
spec.add_dependency 'i18n', '~> 1.0'
|
33
|
+
spec.add_dependency 'iniparse', '~> 1.0'
|
34
|
+
spec.add_dependency 'log4r', '~> 1.1'
|
35
|
+
spec.add_dependency 'netaddr', '~> 2.0', '>= 2.0.4'
|
36
|
+
spec.add_dependency 'ruby_expect', '~> 1.7', '>= 1.7.5'
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-zones
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.97
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Gilbert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|