vagrant-zones 0.1.9 → 0.1.10

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: b51ba5c43caff9de4276241efbdbbb266bc9f6b67578e828053d96248e83ce62
4
+ data.tar.gz: 906ac3a396962c04c1e1cce41f443bc04daa5af38430d4e3d6413855487bc1c4
5
5
  SHA512:
6
- metadata.gz: 3ec7973c3121f41ca77ba23ffadc02bcb1c701d6f75529e8ba469c8e62d3b335dd6d356f133d133bd2359e69de091bf593ff502952a076fd669cd5516371288e
7
- data.tar.gz: 25cc72ff54a1ac5505ac363b875a6e9c3414bc81313125f1efac625da03508185e4c57c4ed8f6d88beefe8487fedadb40453b4ca804cbdbb37b0553dd8528e08
6
+ metadata.gz: 6f7f30ac93cc24cb6deb21787f03a45861419033ca63e7311e7dc3e0d05572314d1617f1e4e449bd783b53851927fdbf9b022dc4094cf85907d8ec92236958a1
7
+ data.tar.gz: 9e674d3c31c5caabd952f7ad7088c5e6e2d8400fdf044a10cb32cf0be3f38071aae5e8ed438b61e99a8212e0079287ad051e502ce23d80df0caac61e8cae01b8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ### [0.1.10](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.9...v0.1.10) (2022-11-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * dns entries ([7cf0246](https://www.github.com/STARTcloud/vagrant-zones/commit/7cf024664f1bcb222c07b30832ae7da91451a482))
9
+
3
10
  ### [0.1.9](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.8...v0.1.9) (2022-11-05)
4
11
 
5
12
 
@@ -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 = 4
64
65
  @cloud_init_enabled = false
65
66
  @cloud_init_conf = 'on'
66
67
  @cloud_init_dnsdomain = nil
@@ -211,13 +211,9 @@ module VagrantPlugins
211
211
  end
212
212
 
213
213
  # This Sanitizes the DNS Records
214
- def dnsservers(uii)
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?
214
+ def dnsservers(uii, opts)
215
+ servers = opts['dns']
216
+ servers = [{ 'nameserver' => '1.1.1.1' }, { 'nameserver' => '8.8.8.8' }] if opts['dns'].nil?
221
217
  uii.info(I18n.t('vagrant_zones.nsservers') + servers.to_s) if config.debug
222
218
  servers
223
219
  end
@@ -270,7 +266,7 @@ module VagrantPlugins
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,7 +972,7 @@ 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
975
+ cclir = config.dns
980
976
  dservers = []
981
977
  cclir['dns'].each do |ns|
982
978
  dservers.append(ns['nameserver'])
@@ -1065,13 +1061,13 @@ module VagrantPlugins
1065
1061
  zlogin(uii, 'rm -rf /etc/netplan/*.yaml')
1066
1062
  ip = ipaddress(uii, opts)
1067
1063
  vnic_name = vname(uii, opts)
1068
- servers = dnsservers(uii)
1064
+ servers = dnsservers(uii, opts)
1069
1065
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
1070
1066
  defrouter = opts[:gateway].to_s
1071
1067
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic'))
1072
1068
  uii.info(" #{vnic_name}")
1073
1069
  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)
1070
+ netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp4]}\n dhcp6: #{opts[:dhcp6]}\n)
1075
1071
  netplan3 = %( set-name: #{vnic_name}\n addresses: [#{ip}/#{shrtsubnet}]\n gateway4: #{defrouter}\n)
1076
1072
  netplan4 = %( nameservers:\n addresses: [#{servers[0]['nameserver']} , #{servers[1]['nameserver']}] )
1077
1073
  netplan = netplan1 + netplan2 + netplan3 + netplan4
@@ -1179,20 +1175,20 @@ module VagrantPlugins
1179
1175
  if zlogin_read.expect(/#{alcheck}/)
1180
1176
  uii.info(I18n.t('vagrant_zones.automated-zlogin-user'))
1181
1177
  zlogin_write.printf("#{user(@machine)}\n")
1182
- sleep(5)
1178
+ sleep(config.login_wait)
1183
1179
  end
1184
1180
 
1185
1181
  if zlogin_read.expect(/#{pcheck}/)
1186
1182
  uii.info(I18n.t('vagrant_zones.automated-zlogin-pass'))
1187
1183
  zlogin_write.printf("#{vagrantuserpass(@machine)}\n")
1188
- sleep(10)
1184
+ sleep(config.login_wait)
1189
1185
  end
1190
1186
 
1191
1187
  zlogin_write.printf("\n")
1192
1188
  if zlogin_read.expect(/#{lcheck}/)
1193
1189
  uii.info(I18n.t('vagrant_zones.automated-zlogin-root'))
1194
1190
  zlogin_write.printf("sudo su\n")
1195
- sleep(10)
1191
+ sleep(config.login_wait)
1196
1192
  Process.kill('HUP', pid)
1197
1193
  end
1198
1194
  end
@@ -1256,7 +1252,7 @@ module VagrantPlugins
1256
1252
  def zoneniczloginsetup_windows(uii, opts, _mac)
1257
1253
  ip = ipaddress(uii, opts)
1258
1254
  vnic_name = vname(uii, opts)
1259
- servers = dnsservers(uii)
1255
+ servers = dnsservers(uii, opts)
1260
1256
  defrouter = opts[:gateway].to_s
1261
1257
  uii.info(I18n.t('vagrant_zones.configure_win_interface_using_vnic'))
1262
1258
  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.10'
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.10
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