vagrant-zones 0.1.41 → 0.1.46

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: c45a64d33fc088a9d230e5dd364c101b1534c44d9da0ae0f2d7dd4900cb6b5b5
4
+ data.tar.gz: 458c22841409f5877381be5ccebb733f4aa09ef827a9f080f7646d1a6d2154ea
5
5
  SHA512:
6
- metadata.gz: 6e70c1cd2aa695ee474e9950c5907937258174cb8887b22f828a23b208588f14b3655dff20a182abaaebb0cc7eeea331671713e0078b47f06696391edcf71982
7
- data.tar.gz: 9b8c1cb87c59402765d6bc863b6cf30140cef421fc092b37a86b47a3de8552a3de49cf248373f0dc8995283184c918325cd117c46a98f2fc9f0b0556e2db5670
6
+ metadata.gz: 7755421a5f6f5fb2a6cf9c9b00182c979a1bf90a77f5e1e0ee92351904c978c2cfc6582184082c60bcd95e2e9978901c12d740194c2b760ee7ebc3a2fae29536
7
+ data.tar.gz: 101e9cc27c8953b10f955f18052fc991a219103bb153c18d8de1d230a1165554ab7ef93cec62dab5ae22cc47f69c711fa375aad92d5b28c9ca823bff97b3bf38
data/CHANGELOG.md CHANGED
@@ -1,5 +1,76 @@
1
1
  # Changelog
2
2
 
3
+ ### [0.1.46](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.45...v0.1.46) (2022-11-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * remove unneeded line ([05916e9](https://www.github.com/STARTcloud/vagrant-zones/commit/05916e9a89b488e1f5e414e34daebff233765096))
9
+
10
+ ### [0.1.45](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.44...v0.1.45) (2022-11-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * version ([7594be6](https://www.github.com/STARTcloud/vagrant-zones/commit/7594be69cf137e3504c5de0d7f12589441bf8444))
16
+
17
+ ### [0.1.44](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.43...v0.1.44) (2022-11-23)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * spacing ([eee020e](https://www.github.com/STARTcloud/vagrant-zones/commit/eee020edbca4d911c9d6c8e600ebd116c1034b68))
23
+
24
+ ### [0.1.43](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.42...v0.1.43) (2022-11-23)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * spacing ([98a3e28](https://www.github.com/STARTcloud/vagrant-zones/commit/98a3e28f9497765841ed649fc9711e1aa44bd752))
30
+
31
+ ### [0.1.42](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.41...v0.1.42) (2022-11-23)
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * missing config var ([19ad3b1](https://www.github.com/STARTcloud/vagrant-zones/commit/19ad3b1b1699f638443ed2bec27f925bcb957fdc))
37
+
38
+ ### [0.1.12](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.11...v0.1.12) (2022-11-23)
39
+
40
+
41
+ ### Bug Fixes
42
+
43
+ * release 0.1.42 ([3406cc3](https://www.github.com/STARTcloud/vagrant-zones/commit/3406cc31ffe06ae118a3392cc1999a9f486ce4bb))
44
+ * version ([18ecccf](https://www.github.com/STARTcloud/vagrant-zones/commit/18ecccf75703819390479e169a86b2908b65a34a))
45
+
46
+ ### [0.1.11](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.10...v0.1.11) (2022-11-23)
47
+
48
+
49
+ ### Bug Fixes
50
+
51
+ * login_wait variable ([713097a](https://www.github.com/STARTcloud/vagrant-zones/commit/713097ad0b4677509231bd2ab81a53e0fa8875c5))
52
+
53
+ ### [0.1.10](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.9...v0.1.10) (2022-11-23)
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * dns entries ([7cf0246](https://www.github.com/STARTcloud/vagrant-zones/commit/7cf024664f1bcb222c07b30832ae7da91451a482))
59
+
60
+ ### [0.1.9](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.8...v0.1.9) (2022-11-05)
61
+
62
+
63
+ ### Bug Fixes
64
+
65
+ * nameserverscloudinit ([506a8c6](https://www.github.com/STARTcloud/vagrant-zones/commit/506a8c69976a03efcc9f62388bbebfdabc870942))
66
+
67
+ ### [0.1.8](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.7...v0.1.8) (2022-11-02)
68
+
69
+
70
+ ### Bug Fixes
71
+
72
+ * version fix ([5fa814e](https://www.github.com/STARTcloud/vagrant-zones/commit/5fa814eac5006344845616e065d49b68ba67326c))
73
+
3
74
  ### [0.1.7](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.6...v0.1.7) (2022-11-02)
4
75
 
5
76
 
@@ -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
@@ -266,11 +263,10 @@ module VagrantPlugins
266
263
  def get_ip_address(_function)
267
264
  config = @machine.provider_config
268
265
  name = @machine.name
269
- # uii.info(I18n.t('vagrant_zones.get_ip_address')) if config.debug
270
266
  @machine.config.vm.networks.each do |_adaptertype, opts|
271
267
  responses = []
272
268
  nic_type = nictype(opts)
273
- if opts[:dhcp] && opts[:managed]
269
+ if opts[:dhcp4] && opts[:managed]
274
270
  vnic_name = "vnic#{nic_type}#{vtype(uii)}_#{config.partition_id}_#{opts[:nic_number]}"
275
271
  PTY.spawn("pfexec zlogin -C #{name}") do |zlogin_read, zlogin_write, pid|
276
272
  command = "ip -4 addr show dev #{vnic_name} | head -n -1 | tail -1 | awk '{ print $2 }' | cut -f1 -d\"/\" \n"
@@ -291,7 +287,7 @@ module VagrantPlugins
291
287
  end
292
288
  Process.kill('HUP', pid)
293
289
  end
294
- elsif (opts[:dhcp] == false || opts[:dhcp].nil?) && opts[:managed]
290
+ elsif (opts[:dhcp4] == false || opts[:dhcp4].nil?) && opts[:managed]
295
291
  ip = opts[:ip].to_s
296
292
  return nil if ip.empty?
297
293
 
@@ -508,13 +504,13 @@ module VagrantPlugins
508
504
  defrouter = opts[:gateway].to_s
509
505
  vnic_name = vname(uii, opts)
510
506
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
511
- servers = dnsservers(uii)
507
+ servers = dnsservers(uii, opts)
512
508
  ## Begin of code block to move to Netplan function
513
509
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic'))
514
510
  uii.info(" #{vnic_name}")
515
511
 
516
512
  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)
513
+ netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp4]}\n dhcp6: #{opts[:dhcp6]}\n)
518
514
  netplan3 = %( set-name: #{vnic_name}\n addresses: [#{ip}/#{shrtsubnet}]\n gateway4: #{defrouter}\n)
519
515
  netplan4 = %( nameservers:\n addresses: [#{servers[0]['nameserver']} , #{servers[1]['nameserver']}] )
520
516
  netplan = netplan1 + netplan2 + netplan3 + netplan4
@@ -533,7 +529,7 @@ module VagrantPlugins
533
529
  defrouter = opts[:gateway].to_s
534
530
  vnic_name = vname(uii, opts)
535
531
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
536
- servers = dnsservers(uii)
532
+ servers = dnsservers(uii, opts)
537
533
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic_dladm'))
538
534
  uii.info(" #{vnic_name}")
539
535
 
@@ -976,10 +972,14 @@ module VagrantPlugins
976
972
  uii.info(" #{ccip}") unless ccip.nil?
977
973
  execute(false, %(#{zcfg}"add attr; set name=password; set value=#{ccip}; set type=string; end;")) unless ccip.nil?
978
974
 
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?
975
+ cclir = config.dns
976
+ dservers = []
977
+ cclir['dns'].each do |ns|
978
+ dservers.append(ns['nameserver'])
979
+ end
980
+ uii.info(I18n.t('vagrant_zones.setting_cloud_resolvers')) unless dservers.nil?
981
+ uii.info(" #{dservers}") unless dservers.nil?
982
+ execute(false, %(#{zcfg}"add attr; set name=resolvers; set value=#{dservers}; set type=string; end;")) unless dservers.nil?
983
983
 
984
984
  ccisk = config.cloud_init_sshkey
985
985
  uii.info(I18n.t('vagrant_zones.setting_cloud_ssh_key')) unless ccisk.nil?
@@ -1061,13 +1061,13 @@ module VagrantPlugins
1061
1061
  zlogin(uii, 'rm -rf /etc/netplan/*.yaml')
1062
1062
  ip = ipaddress(uii, opts)
1063
1063
  vnic_name = vname(uii, opts)
1064
- servers = dnsservers(uii)
1064
+ servers = dnsservers(uii, opts)
1065
1065
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
1066
1066
  defrouter = opts[:gateway].to_s
1067
1067
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic'))
1068
1068
  uii.info(" #{vnic_name}")
1069
1069
  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)
1070
+ netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp4]}\n dhcp6: #{opts[:dhcp6]}\n)
1071
1071
  netplan3 = %( set-name: #{vnic_name}\n addresses: [#{ip}/#{shrtsubnet}]\n gateway4: #{defrouter}\n)
1072
1072
  netplan4 = %( nameservers:\n addresses: [#{servers[0]['nameserver']} , #{servers[1]['nameserver']}] )
1073
1073
  netplan = netplan1 + netplan2 + netplan3 + netplan4
@@ -1175,20 +1175,20 @@ module VagrantPlugins
1175
1175
  if zlogin_read.expect(/#{alcheck}/)
1176
1176
  uii.info(I18n.t('vagrant_zones.automated-zlogin-user'))
1177
1177
  zlogin_write.printf("#{user(@machine)}\n")
1178
- sleep(5)
1178
+ sleep(config.login_wait)
1179
1179
  end
1180
1180
 
1181
1181
  if zlogin_read.expect(/#{pcheck}/)
1182
1182
  uii.info(I18n.t('vagrant_zones.automated-zlogin-pass'))
1183
1183
  zlogin_write.printf("#{vagrantuserpass(@machine)}\n")
1184
- sleep(10)
1184
+ sleep(config.login_wait)
1185
1185
  end
1186
1186
 
1187
1187
  zlogin_write.printf("\n")
1188
1188
  if zlogin_read.expect(/#{lcheck}/)
1189
1189
  uii.info(I18n.t('vagrant_zones.automated-zlogin-root'))
1190
1190
  zlogin_write.printf("sudo su\n")
1191
- sleep(10)
1191
+ sleep(config.login_wait)
1192
1192
  Process.kill('HUP', pid)
1193
1193
  end
1194
1194
  end
@@ -1252,7 +1252,7 @@ module VagrantPlugins
1252
1252
  def zoneniczloginsetup_windows(uii, opts, _mac)
1253
1253
  ip = ipaddress(uii, opts)
1254
1254
  vnic_name = vname(uii, opts)
1255
- servers = dnsservers(uii)
1255
+ servers = dnsservers(uii, opts)
1256
1256
  defrouter = opts[:gateway].to_s
1257
1257
  uii.info(I18n.t('vagrant_zones.configure_win_interface_using_vnic'))
1258
1258
  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.46'
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.46
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