vagrant-zones 0.1.9 → 0.1.12

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: a876da894bbf6fc4fe1e1ae0761b37af4d8977088fe82e67bd75d0e3af7c0c86
4
- data.tar.gz: abfbdb4140d59fa23e2dd35755ed8391ddcc6376ee6fd726130ca9d894b3e4d3
3
+ metadata.gz: d121585efc8abfbeaf00780b1db4253f45a26a70a0ec695a2bfee67173145104
4
+ data.tar.gz: 285ebe5ef90c665d3f1877356f4e1951a03e3f2a5c245bd2788db4ed2490e684
5
5
  SHA512:
6
- metadata.gz: 3ec7973c3121f41ca77ba23ffadc02bcb1c701d6f75529e8ba469c8e62d3b335dd6d356f133d133bd2359e69de091bf593ff502952a076fd669cd5516371288e
7
- data.tar.gz: 25cc72ff54a1ac5505ac363b875a6e9c3414bc81313125f1efac625da03508185e4c57c4ed8f6d88beefe8487fedadb40453b4ca804cbdbb37b0553dd8528e08
6
+ metadata.gz: 6004a81fd9f3ea91eb2e4d94f752a7ee891f6cf528d476a54f2ec8be3d405fc9246640da7d5a6f64a0aecf3e1aea887dbec3e7fd94927d3eef19e894379562f9
7
+ data.tar.gz: 88cfcf57f9ef5af68d4af87cf36c758d03bf40090f522589dac019913624d517c0bc91dd1b910f9ca98241e9a0710650009f5f4e5be0c49bf9223eec0745e177
data/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ### [0.1.42](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.41...v0.1.42) (2022-11-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * missing config var ([19ad3b1](https://www.github.com/STARTcloud/vagrant-zones/commit/19ad3b1b1699f638443ed2bec27f925bcb957fdc))
9
+
10
+ ### [0.1.12](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.11...v0.1.12) (2022-11-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * release 0.1.42 ([3406cc3](https://www.github.com/STARTcloud/vagrant-zones/commit/3406cc31ffe06ae118a3392cc1999a9f486ce4bb))
16
+ * version ([18ecccf](https://www.github.com/STARTcloud/vagrant-zones/commit/18ecccf75703819390479e169a86b2908b65a34a))
17
+
18
+ ### [0.1.11](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.10...v0.1.11) (2022-11-23)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * login_wait variable ([713097a](https://www.github.com/STARTcloud/vagrant-zones/commit/713097ad0b4677509231bd2ab81a53e0fa8875c5))
24
+
25
+ ### [0.1.10](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.9...v0.1.10) (2022-11-23)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * dns entries ([7cf0246](https://www.github.com/STARTcloud/vagrant-zones/commit/7cf024664f1bcb222c07b30832ae7da91451a482))
31
+
3
32
  ### [0.1.9](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.8...v0.1.9) (2022-11-05)
4
33
 
5
34
 
@@ -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,7 +973,7 @@ 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
976
+ cclir = config.dns
980
977
  dservers = []
981
978
  cclir['dns'].each do |ns|
982
979
  dservers.append(ns['nameserver'])
@@ -1065,13 +1062,13 @@ module VagrantPlugins
1065
1062
  zlogin(uii, 'rm -rf /etc/netplan/*.yaml')
1066
1063
  ip = ipaddress(uii, opts)
1067
1064
  vnic_name = vname(uii, opts)
1068
- servers = dnsservers(uii)
1065
+ servers = dnsservers(uii, opts)
1069
1066
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
1070
1067
  defrouter = opts[:gateway].to_s
1071
1068
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic'))
1072
1069
  uii.info(" #{vnic_name}")
1073
1070
  netplan1 = %(network:\n version: 2\n ethernets:\n #{vnic_name}:\n match:\n macaddress: #{mac}\n)
1074
- 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)
1075
1072
  netplan3 = %( set-name: #{vnic_name}\n addresses: [#{ip}/#{shrtsubnet}]\n gateway4: #{defrouter}\n)
1076
1073
  netplan4 = %( nameservers:\n addresses: [#{servers[0]['nameserver']} , #{servers[1]['nameserver']}] )
1077
1074
  netplan = netplan1 + netplan2 + netplan3 + netplan4
@@ -1179,20 +1176,20 @@ module VagrantPlugins
1179
1176
  if zlogin_read.expect(/#{alcheck}/)
1180
1177
  uii.info(I18n.t('vagrant_zones.automated-zlogin-user'))
1181
1178
  zlogin_write.printf("#{user(@machine)}\n")
1182
- sleep(5)
1179
+ sleep(config.login_wait)
1183
1180
  end
1184
1181
 
1185
1182
  if zlogin_read.expect(/#{pcheck}/)
1186
1183
  uii.info(I18n.t('vagrant_zones.automated-zlogin-pass'))
1187
1184
  zlogin_write.printf("#{vagrantuserpass(@machine)}\n")
1188
- sleep(10)
1185
+ sleep(config.login_wait)
1189
1186
  end
1190
1187
 
1191
1188
  zlogin_write.printf("\n")
1192
1189
  if zlogin_read.expect(/#{lcheck}/)
1193
1190
  uii.info(I18n.t('vagrant_zones.automated-zlogin-root'))
1194
1191
  zlogin_write.printf("sudo su\n")
1195
- sleep(10)
1192
+ sleep(config.login_wait)
1196
1193
  Process.kill('HUP', pid)
1197
1194
  end
1198
1195
  end
@@ -1256,7 +1253,7 @@ module VagrantPlugins
1256
1253
  def zoneniczloginsetup_windows(uii, opts, _mac)
1257
1254
  ip = ipaddress(uii, opts)
1258
1255
  vnic_name = vname(uii, opts)
1259
- servers = dnsservers(uii)
1256
+ servers = dnsservers(uii, opts)
1260
1257
  defrouter = opts[:gateway].to_s
1261
1258
  uii.info(I18n.t('vagrant_zones.configure_win_interface_using_vnic'))
1262
1259
  sleep(60)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module VagrantPlugins
4
4
  module ProviderZone
5
- VERSION = '0.1.9'
5
+ VERSION = '0.1.12'
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.9
4
+ version: 0.1.12
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-05 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