vagrant-zones 0.1.83 → 0.1.85

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: c80e9df09414accd694e937073c648233e2250648d350c6a171c27fcae52a991
4
- data.tar.gz: c92979008d6fca5b934a3d28e96c1de4bb3df44d92b0c30b8993eec0c21b22e3
3
+ metadata.gz: 6bf20cdda311a82fdc0cbefd7c24dfbfb0903d7f0576e40aa15cfdbb1aec1c62
4
+ data.tar.gz: da2ab2b6ce91f6ae5b83ede4fdf21d3e3469caa27fd7af4df9a5675c20072c15
5
5
  SHA512:
6
- metadata.gz: 135df9df59eb69ded7b1f4e9bc29d49e92509cac464e97901bfb601f82883a7efc81f91291abb49d6db906811c0595354b76abe203076de32e0b3386b5605c50
7
- data.tar.gz: 369de04de5d425e0d9609db27ac883911c3b1f53a7e1de3560bec8bc725882fb28bb013488d7accfcdbccc10481b7bd996f8982849a800bbcc3e1241fcaedfec
6
+ metadata.gz: 20ff28058c4f6bdedb2caee182c45a871c2ff75898f557e33acdae1a125127c70a931d24b17b70f97071d85a63e30a45088617d14c40b675ce97cbc4db3bf8bb
7
+ data.tar.gz: 0c02ad7bc067abffb687a0f4b5b9120fa88605a4ac944bbee62285dbe2ae5a91362b7d7d8173164b81ceb217027434ad7c1a86e059bebedb4379c6455dac6320
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.85](https://github.com/STARTcloud/vagrant-zones/compare/v0.1.84...v0.1.85) (2023-12-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * skip unaffected nics ([b4b4ae3](https://github.com/STARTcloud/vagrant-zones/commit/b4b4ae3ed336ace9f37966717f751288aa90965c))
9
+
10
+ ## [0.1.84](https://github.com/STARTcloud/vagrant-zones/compare/v0.1.83...v0.1.84) (2023-12-14)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * adding removal of zonecfg provisional network after startup ([8885044](https://github.com/STARTcloud/vagrant-zones/commit/88850440213a7ffce82463b02dab56c8c9d05d69))
16
+ * disable parallel by default ([98de187](https://github.com/STARTcloud/vagrant-zones/commit/98de187ab53a123a95d489a4bd8f7383d1b788ca))
17
+ * enable parallel builds #dangerwillrobinson ([5bf2cea](https://github.com/STARTcloud/vagrant-zones/commit/5bf2ceaf3adaf42553afe7a38ab9c2a665d7ff21))
18
+ * remove unneccessary lines from zonenicdel ([39fef96](https://github.com/STARTcloud/vagrant-zones/commit/39fef96b85445c472595154ebb59db8f190a30c4))
19
+ * remove unneccessary lines from zonenicdel ([227ab2c](https://github.com/STARTcloud/vagrant-zones/commit/227ab2cdb06eb8a414b2f13e567f6be70ac8613c))
20
+ * renenable parallel ([38c2bf2](https://github.com/STARTcloud/vagrant-zones/commit/38c2bf27e905f8a4099532fa3d193d3825d4ab95))
21
+ * some rubocop warnings ([88b00c4](https://github.com/STARTcloud/vagrant-zones/commit/88b00c465a3926aa0ce4dc8881592fd755dfd5dc))
22
+ * typo ) ([b385505](https://github.com/STARTcloud/vagrant-zones/commit/b385505757ac5e078522add1e3e44b99c9369417))
23
+ * windows multiple nameservers ([430be2d](https://github.com/STARTcloud/vagrant-zones/commit/430be2d868be34a9724b454ff571006c7632df7a))
24
+ * windows namservers ([b271ae1](https://github.com/STARTcloud/vagrant-zones/commit/b271ae1dbb436750cb4b074f99d10f5922c0ee0c))
25
+
3
26
  ## [0.1.83](https://github.com/STARTcloud/vagrant-zones/compare/v0.1.82...v0.1.83) (2023-12-12)
4
27
 
5
28
 
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'log4r'
4
+ require 'securerandom'
5
+ require 'digest/md5'
6
+
7
+ module VagrantPlugins
8
+ module ProviderZone
9
+ module Action
10
+ # This is use to define the network
11
+ class NetworkingCleanup
12
+ def initialize(app, _env)
13
+ @logger = Log4r::Logger.new('vagrant_zones::action::import')
14
+ @app = app
15
+ end
16
+
17
+ def call(env)
18
+ @machine = env[:machine]
19
+ @driver = @machine.provider.driver
20
+ @driver.network(env[:ui], 'delete_provisional')
21
+ @app.call(env)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -27,6 +27,7 @@ module VagrantPlugins
27
27
  b2.use WaitTillBoot
28
28
  b2.use Setup
29
29
  b2.use WaitTillUp
30
+ b2.use NetworkingCleanup
30
31
  b2.use Provision
31
32
  b2.use SetHostname
32
33
  b2.use SyncedFolders
@@ -186,6 +187,7 @@ module VagrantPlugins
186
187
  autoload :Network, action_root.join('network')
187
188
  autoload :Setup, action_root.join('setup')
188
189
  autoload :Start, action_root.join('start')
190
+ autoload :NetworkingCleanup, action_root.join('network_cleanup')
189
191
  autoload :IsCreated, action_root.join('is_created')
190
192
  autoload :NotCreated, action_root.join('not_created')
191
193
  autoload :CreateSnapshots, action_root.join('create_zfs_snapshots')
@@ -7,7 +7,7 @@ module VagrantPlugins
7
7
  # This is used define the variables for the project
8
8
  class Config < Vagrant.plugin('2', :config)
9
9
  # rubocop:disable Layout/LineLength
10
- attr_accessor :brand, :autoboot, :setup_method, :safe_restart, :allowed_address, :safe_shutdown, :boxshortname, :kernel, :debug, :debug_boot, :private_network, :winalcheck, :winlcheck, :lcheck, :alcheck, :snapshot_script, :diskif, :netif, :cdroms, :disk1path, :disk1size, :cpus, :cpu_configuration, :boot, :complex_cpu_conf, :memory, :vagrant_user, :vagrant_user_private_key_path, :setup_wait, :on_demand_vnics, :clean_shutdown_time, :dhcp4, :vagrant_user_pass, :firmware_type, :vm_type, :partition_id, :shared_disk_enabled, :shared_dir, :acpi, :os_type, :console, :consolehost, :consoleport, :console_onboot, :hostbridge, :sshport, :rdpport, :override, :additional_disks, :cloud_init_resolvers, :cloud_init_enabled, :cloud_init_dnsdomain, :cloud_init_password, :cloud_init_sshkey, :cloud_init_conf, :dns, :box, :vagrant_cloud_creator, :winbooted_string, :booted_string, :zunlockbootkey, :zunlockboot, :xhci_enabled, :login_wait
10
+ attr_accessor :brand, :autoboot, :setup_method, :safe_restart, :allowed_address, :post_provision_boot, :safe_shutdown, :boxshortname, :kernel, :debug, :debug_boot, :private_network, :winalcheck, :winlcheck, :lcheck, :alcheck, :snapshot_script, :diskif, :netif, :cdroms, :disk1path, :disk1size, :cpus, :cpu_configuration, :boot, :complex_cpu_conf, :memory, :vagrant_user, :vagrant_user_private_key_path, :setup_wait, :on_demand_vnics, :clean_shutdown_time, :dhcp4, :vagrant_user_pass, :firmware_type, :vm_type, :partition_id, :shared_disk_enabled, :shared_dir, :acpi, :os_type, :console, :consolehost, :consoleport, :console_onboot, :hostbridge, :sshport, :rdpport, :override, :additional_disks, :cloud_init_resolvers, :cloud_init_enabled, :cloud_init_dnsdomain, :cloud_init_password, :cloud_init_sshkey, :cloud_init_conf, :dns, :box, :vagrant_cloud_creator, :winbooted_string, :booted_string, :zunlockbootkey, :zunlockboot, :xhci_enabled, :login_wait
11
11
 
12
12
  # rubocop:enable Layout/LineLength
13
13
 
@@ -16,6 +16,7 @@ module VagrantPlugins
16
16
  @brand = 'bhyve'
17
17
  @additional_disks = UNSET_VALUE
18
18
  @autoboot = true
19
+ @post_provision_boot = false
19
20
  @kernel = UNSET_VALUE
20
21
  @boxshortname = UNSET_VALUE
21
22
  @cdroms = nil
@@ -321,6 +321,7 @@ module VagrantPlugins
321
321
  when 'public_network'
322
322
  zonenicdel(uii, opts) if state == 'delete' && !config.on_demand_vnics
323
323
  zonecfgnicconfig(uii, opts) if state == 'config'
324
+ zonecfgnicconfigdelete(uii, opts) if state == 'delete_provisional' && config.on_demand_vnics
324
325
  zoneniccreate(uii, opts) if state == 'create' && !config.on_demand_vnics
325
326
  zonenicstpzloginsetup(uii, opts, config) if state == 'setup' && config.setup_method == 'zlogin'
326
327
  when 'private_network'
@@ -1075,6 +1076,14 @@ module VagrantPlugins
1075
1076
  end
1076
1077
  end
1077
1078
 
1079
+ ## zonecfg function for for Networking
1080
+ def zonecfgnicconfigdelete(uii, opts)
1081
+ vnic_name = vname(uii, opts)
1082
+ uii.info(I18n.t('vagrant_zones.vnic_conf_del')) if opts[:provisional]
1083
+ uii.info(" #{vnic_name}") if opts[:provisional]
1084
+ execute(false, "#{@pfexec} zonecfg -z #{@machine.name} remove net physical=#{vnic_name}") if opts[:provisional]
1085
+ end
1086
+
1078
1087
  # This helps us set the zone configurations for the zone
1079
1088
  def zonecfg(uii)
1080
1089
  name = @machine.name
@@ -1327,7 +1336,6 @@ module VagrantPlugins
1327
1336
  def zoneniczloginsetup_windows(uii, opts, _mac)
1328
1337
  ip = ipaddress(uii, opts)
1329
1338
  vnic_name = vname(uii, opts)
1330
- servers = dnsservers(uii, opts) unless opts[:dns].nil?
1331
1339
  defrouter = opts[:gateway].to_s
1332
1340
  uii.info(I18n.t('vagrant_zones.configure_win_interface_using_vnic'))
1333
1341
  sleep(60)
@@ -1336,13 +1344,17 @@ module VagrantPlugins
1336
1344
  ## to set the proper VNIC name if using multiple adapters
1337
1345
  rename_adapter = %(netsh interface set interface name = "Ethernet" newname = "#{vnic_name}")
1338
1346
  cmd = %(netsh interface ipv4 set address name="#{vnic_name}" static #{ip} #{opts[:netmask]} #{defrouter})
1339
- dns1 = %(netsh int ipv4 set dns name="#{vnic_name}" static #{servers[0]['nameserver']} primary validate=no) unless opts[:dns].nil?
1340
- dns2 = %(netsh int ipv4 add dns name="#{vnic_name}" #{servers[1]['nameserver']} index=2 validate=no) unless opts[:dns].nil?
1341
-
1342
1347
  uii.info(I18n.t('vagrant_zones.win_applied_rename_adapter')) if zlogin(uii, rename_adapter)
1343
1348
  uii.info(I18n.t('vagrant_zones.win_applied_static')) if zlogin(uii, cmd)
1349
+ return unless opts[:dns].nil?
1350
+
1351
+ ip_addresses = dnsservers(uii, opts).map { |hash| hash['nameserver'] }
1352
+ dns1 = %(netsh int ipv4 set dns name="#{vnic_name}" static #{ip_addresses[0]} primary validate=no)
1344
1353
  uii.info(I18n.t('vagrant_zones.win_applied_dns1')) if zlogin(uii, dns1)
1345
- uii.info(I18n.t('vagrant_zones.win_applied_dns2')) if zlogin(uii, dns2)
1354
+ ip_addresses[1..].each_with_index do |dns, index|
1355
+ additional_nameservers = %(netsh int ipv4 add dns name="#{vnic_name}" #{dns} index="#{index + 2}" validate=no)
1356
+ uii.info(I18n.t('vagrant_zones.win_applied_dns2')) if zlogin(uii, additional_nameservers)
1357
+ end
1346
1358
  end
1347
1359
 
1348
1360
  def zlogin_win_boot(uii)
@@ -20,9 +20,7 @@ module VagrantPlugins
20
20
  require_relative 'config'
21
21
  Config
22
22
  end
23
- ## Experimental Parallel Execucution
24
- ## provider(:zone, parallel: true) do
25
- provider(:zone) do
23
+ provider(:zone, parallel: false) do
26
24
  require_relative 'provider'
27
25
  Provider
28
26
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module VagrantPlugins
4
4
  module ProviderZone
5
- VERSION = '0.1.83'
5
+ VERSION = '0.1.85'
6
6
  NAME = 'vagrant-zones'
7
7
  end
8
8
  end
data/locales/en.yml CHANGED
@@ -256,6 +256,8 @@ en:
256
256
  Creating networking interfaces for zone:
257
257
  nat_vnic_setup: |-
258
258
  - Setting up NAT VNIC:
259
+ vnic_conf_del: |-
260
+ - Deleting zonecg for provisional VNIC:
259
261
  forwarding_nat: |-
260
262
  - Enabling NAT forwarding:
261
263
  configuring_nat: |-
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.83
4
+ version: 0.1.85
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Gilbert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-12 00:00:00.000000000 Z
11
+ date: 2023-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -132,6 +132,7 @@ files:
132
132
  - lib/vagrant-zones/action/import.rb
133
133
  - lib/vagrant-zones/action/is_created.rb
134
134
  - lib/vagrant-zones/action/network.rb
135
+ - lib/vagrant-zones/action/network_cleanup.rb
135
136
  - lib/vagrant-zones/action/not_created.rb
136
137
  - lib/vagrant-zones/action/package.rb
137
138
  - lib/vagrant-zones/action/prepare_nfs_valid_ids.rb