vagrant-zones 0.1.41 → 0.1.44

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: 888c846d3f7cb6ed5b42036bc9610a55443b6d2e9b01c901c5f6559f362949d0
4
- data.tar.gz: 250c0f9924123d10075da67b52d0fe70fa4771cee6d7d33e88939bd981e06ec2
3
+ metadata.gz: 967837c3c3d0fe50f53375d806beee05f2aa4ec5270c7b028bb8b69f783bb338
4
+ data.tar.gz: dd61e58ead769e79ad625327e87457ceeadb048ba0efa2405dec1621f5657914
5
5
  SHA512:
6
- metadata.gz: 6e70c1cd2aa695ee474e9950c5907937258174cb8887b22f828a23b208588f14b3655dff20a182abaaebb0cc7eeea331671713e0078b47f06696391edcf71982
7
- data.tar.gz: 9b8c1cb87c59402765d6bc863b6cf30140cef421fc092b37a86b47a3de8552a3de49cf248373f0dc8995283184c918325cd117c46a98f2fc9f0b0556e2db5670
6
+ metadata.gz: 356ffb8315792d279bd05cc033189d870afb3ae72b9b5a7130465fbc5db8983a7def010327f05937882011ed1beb48024db5ace448f8656613e8bc8df509f283
7
+ data.tar.gz: 13b8f7a5604b739e8aa0236b1a19698db438483ab9f92f3517fbd61ac56f9a5f317ac3f4b297b1f30a743531e56201cf9b52cd93fd3463f0c2982b13b3ad159a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # Changelog
2
2
 
3
+ ### [0.1.45](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.44...v0.1.45) (2022-11-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * version ([7594be6](https://www.github.com/STARTcloud/vagrant-zones/commit/7594be69cf137e3504c5de0d7f12589441bf8444))
9
+
10
+ ### [0.1.44](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.43...v0.1.44) (2022-11-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * spacing ([eee020e](https://www.github.com/STARTcloud/vagrant-zones/commit/eee020edbca4d911c9d6c8e600ebd116c1034b68))
16
+
17
+ ### [0.1.43](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.42...v0.1.43) (2022-11-23)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * spacing ([98a3e28](https://www.github.com/STARTcloud/vagrant-zones/commit/98a3e28f9497765841ed649fc9711e1aa44bd752))
23
+
24
+ ### [0.1.42](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.41...v0.1.42) (2022-11-23)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * missing config var ([19ad3b1](https://www.github.com/STARTcloud/vagrant-zones/commit/19ad3b1b1699f638443ed2bec27f925bcb957fdc))
30
+
31
+ ### [0.1.12](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.11...v0.1.12) (2022-11-23)
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * release 0.1.42 ([3406cc3](https://www.github.com/STARTcloud/vagrant-zones/commit/3406cc31ffe06ae118a3392cc1999a9f486ce4bb))
37
+ * version ([18ecccf](https://www.github.com/STARTcloud/vagrant-zones/commit/18ecccf75703819390479e169a86b2908b65a34a))
38
+
39
+ ### [0.1.11](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.10...v0.1.11) (2022-11-23)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * login_wait variable ([713097a](https://www.github.com/STARTcloud/vagrant-zones/commit/713097ad0b4677509231bd2ab81a53e0fa8875c5))
45
+
46
+ ### [0.1.10](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.9...v0.1.10) (2022-11-23)
47
+
48
+
49
+ ### Bug Fixes
50
+
51
+ * dns entries ([7cf0246](https://www.github.com/STARTcloud/vagrant-zones/commit/7cf024664f1bcb222c07b30832ae7da91451a482))
52
+
53
+ ### [0.1.9](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.8...v0.1.9) (2022-11-05)
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * nameserverscloudinit ([506a8c6](https://www.github.com/STARTcloud/vagrant-zones/commit/506a8c69976a03efcc9f62388bbebfdabc870942))
59
+
60
+ ### [0.1.8](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.7...v0.1.8) (2022-11-02)
61
+
62
+
63
+ ### Bug Fixes
64
+
65
+ * version fix ([5fa814e](https://www.github.com/STARTcloud/vagrant-zones/commit/5fa814eac5006344845616e065d49b68ba67326c))
66
+
3
67
  ### [0.1.7](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.6...v0.1.7) (2022-11-02)
4
68
 
5
69
 
@@ -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, :clean_shutdown_time, :dhcp, :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
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, :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
 
@@ -61,6 +61,7 @@ module VagrantPlugins
61
61
  @vagrant_user_private_key_path = './id_rsa'
62
62
  @xhci_enabled = 'off'
63
63
  @override = false
64
+ @login_wait = 5
64
65
  @cloud_init_enabled = false
65
66
  @cloud_init_conf = 'on'
66
67
  @cloud_init_dnsdomain = nil
@@ -211,13 +211,10 @@ module VagrantPlugins
211
211
  end
212
212
 
213
213
  # This Sanitizes the DNS Records
214
- def dnsservers(uii)
214
+ def dnsservers(uii, opts)
215
215
  config = @machine.provider_config
216
- servers = []
217
- config.dns.each do |server|
218
- servers.append(server)
219
- end
220
- servers = [{ 'nameserver' => '1.1.1.1' }, { 'nameserver' => '8.8.8.8' }] if config.dns.nil?
216
+ servers = opts['dns']
217
+ servers = [{ 'nameserver' => '1.1.1.1' }, { 'nameserver' => '8.8.8.8' }] if opts['dns'].nil?
221
218
  uii.info(I18n.t('vagrant_zones.nsservers') + servers.to_s) if config.debug
222
219
  servers
223
220
  end
@@ -270,7 +267,7 @@ module VagrantPlugins
270
267
  @machine.config.vm.networks.each do |_adaptertype, opts|
271
268
  responses = []
272
269
  nic_type = nictype(opts)
273
- if opts[:dhcp] && opts[:managed]
270
+ if opts[:dhcp4] && opts[:managed]
274
271
  vnic_name = "vnic#{nic_type}#{vtype(uii)}_#{config.partition_id}_#{opts[:nic_number]}"
275
272
  PTY.spawn("pfexec zlogin -C #{name}") do |zlogin_read, zlogin_write, pid|
276
273
  command = "ip -4 addr show dev #{vnic_name} | head -n -1 | tail -1 | awk '{ print $2 }' | cut -f1 -d\"/\" \n"
@@ -291,7 +288,7 @@ module VagrantPlugins
291
288
  end
292
289
  Process.kill('HUP', pid)
293
290
  end
294
- elsif (opts[:dhcp] == false || opts[:dhcp].nil?) && opts[:managed]
291
+ elsif (opts[:dhcp4] == false || opts[:dhcp4].nil?) && opts[:managed]
295
292
  ip = opts[:ip].to_s
296
293
  return nil if ip.empty?
297
294
 
@@ -508,13 +505,13 @@ module VagrantPlugins
508
505
  defrouter = opts[:gateway].to_s
509
506
  vnic_name = vname(uii, opts)
510
507
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
511
- servers = dnsservers(uii)
508
+ servers = dnsservers(uii, opts)
512
509
  ## Begin of code block to move to Netplan function
513
510
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic'))
514
511
  uii.info(" #{vnic_name}")
515
512
 
516
513
  netplan1 = %(network:\n version: 2\n ethernets:\n #{vnic_name}:\n match:\n macaddress: #{mac}\n)
517
- netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp]}\n dhcp6: #{opts[:dhcp6]}\n)
514
+ netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp4]}\n dhcp6: #{opts[:dhcp6]}\n)
518
515
  netplan3 = %( set-name: #{vnic_name}\n addresses: [#{ip}/#{shrtsubnet}]\n gateway4: #{defrouter}\n)
519
516
  netplan4 = %( nameservers:\n addresses: [#{servers[0]['nameserver']} , #{servers[1]['nameserver']}] )
520
517
  netplan = netplan1 + netplan2 + netplan3 + netplan4
@@ -533,7 +530,7 @@ module VagrantPlugins
533
530
  defrouter = opts[:gateway].to_s
534
531
  vnic_name = vname(uii, opts)
535
532
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
536
- servers = dnsservers(uii)
533
+ servers = dnsservers(uii, opts)
537
534
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic_dladm'))
538
535
  uii.info(" #{vnic_name}")
539
536
 
@@ -976,10 +973,14 @@ module VagrantPlugins
976
973
  uii.info(" #{ccip}") unless ccip.nil?
977
974
  execute(false, %(#{zcfg}"add attr; set name=password; set value=#{ccip}; set type=string; end;")) unless ccip.nil?
978
975
 
979
- cclir = config.cloud_init_resolvers
980
- uii.info(I18n.t('vagrant_zones.setting_cloud_resolvers')) unless cclir.nil?
981
- uii.info(" #{cclir}") unless cclir.nil?
982
- execute(false, %(#{zcfg}"add attr; set name=resolvers; set value=#{cclir}; set type=string; end;")) unless cclir.nil?
976
+ cclir = config.dns
977
+ dservers = []
978
+ cclir['dns'].each do |ns|
979
+ dservers.append(ns['nameserver'])
980
+ end
981
+ uii.info(I18n.t('vagrant_zones.setting_cloud_resolvers')) unless dservers.nil?
982
+ uii.info(" #{dservers}") unless dservers.nil?
983
+ execute(false, %(#{zcfg}"add attr; set name=resolvers; set value=#{dservers}; set type=string; end;")) unless dservers.nil?
983
984
 
984
985
  ccisk = config.cloud_init_sshkey
985
986
  uii.info(I18n.t('vagrant_zones.setting_cloud_ssh_key')) unless ccisk.nil?
@@ -1061,13 +1062,13 @@ module VagrantPlugins
1061
1062
  zlogin(uii, 'rm -rf /etc/netplan/*.yaml')
1062
1063
  ip = ipaddress(uii, opts)
1063
1064
  vnic_name = vname(uii, opts)
1064
- servers = dnsservers(uii)
1065
+ servers = dnsservers(uii, opts)
1065
1066
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
1066
1067
  defrouter = opts[:gateway].to_s
1067
1068
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic'))
1068
1069
  uii.info(" #{vnic_name}")
1069
1070
  netplan1 = %(network:\n version: 2\n ethernets:\n #{vnic_name}:\n match:\n macaddress: #{mac}\n)
1070
- netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp]}\n dhcp6: #{opts[:dhcp6]}\n)
1071
+ netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp4]}\n dhcp6: #{opts[:dhcp6]}\n)
1071
1072
  netplan3 = %( set-name: #{vnic_name}\n addresses: [#{ip}/#{shrtsubnet}]\n gateway4: #{defrouter}\n)
1072
1073
  netplan4 = %( nameservers:\n addresses: [#{servers[0]['nameserver']} , #{servers[1]['nameserver']}] )
1073
1074
  netplan = netplan1 + netplan2 + netplan3 + netplan4
@@ -1175,20 +1176,20 @@ module VagrantPlugins
1175
1176
  if zlogin_read.expect(/#{alcheck}/)
1176
1177
  uii.info(I18n.t('vagrant_zones.automated-zlogin-user'))
1177
1178
  zlogin_write.printf("#{user(@machine)}\n")
1178
- sleep(5)
1179
+ sleep(config.login_wait)
1179
1180
  end
1180
1181
 
1181
1182
  if zlogin_read.expect(/#{pcheck}/)
1182
1183
  uii.info(I18n.t('vagrant_zones.automated-zlogin-pass'))
1183
1184
  zlogin_write.printf("#{vagrantuserpass(@machine)}\n")
1184
- sleep(10)
1185
+ sleep(config.login_wait)
1185
1186
  end
1186
1187
 
1187
1188
  zlogin_write.printf("\n")
1188
1189
  if zlogin_read.expect(/#{lcheck}/)
1189
1190
  uii.info(I18n.t('vagrant_zones.automated-zlogin-root'))
1190
1191
  zlogin_write.printf("sudo su\n")
1191
- sleep(10)
1192
+ sleep(config.login_wait)
1192
1193
  Process.kill('HUP', pid)
1193
1194
  end
1194
1195
  end
@@ -1252,7 +1253,7 @@ module VagrantPlugins
1252
1253
  def zoneniczloginsetup_windows(uii, opts, _mac)
1253
1254
  ip = ipaddress(uii, opts)
1254
1255
  vnic_name = vname(uii, opts)
1255
- servers = dnsservers(uii)
1256
+ servers = dnsservers(uii, opts)
1256
1257
  defrouter = opts[:gateway].to_s
1257
1258
  uii.info(I18n.t('vagrant_zones.configure_win_interface_using_vnic'))
1258
1259
  sleep(60)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module VagrantPlugins
4
4
  module ProviderZone
5
- VERSION = '0.1.41'
5
+ VERSION = '0.1.44'
6
6
  end
7
7
  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.41
4
+ version: 0.1.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Gilbert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-02 00:00:00.000000000 Z
11
+ date: 2022-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n