vagrant-zones 0.1.12 → 0.1.41

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: d121585efc8abfbeaf00780b1db4253f45a26a70a0ec695a2bfee67173145104
4
- data.tar.gz: 285ebe5ef90c665d3f1877356f4e1951a03e3f2a5c245bd2788db4ed2490e684
3
+ metadata.gz: 888c846d3f7cb6ed5b42036bc9610a55443b6d2e9b01c901c5f6559f362949d0
4
+ data.tar.gz: 250c0f9924123d10075da67b52d0fe70fa4771cee6d7d33e88939bd981e06ec2
5
5
  SHA512:
6
- metadata.gz: 6004a81fd9f3ea91eb2e4d94f752a7ee891f6cf528d476a54f2ec8be3d405fc9246640da7d5a6f64a0aecf3e1aea887dbec3e7fd94927d3eef19e894379562f9
7
- data.tar.gz: 88cfcf57f9ef5af68d4af87cf36c758d03bf40090f522589dac019913624d517c0bc91dd1b910f9ca98241e9a0710650009f5f4e5be0c49bf9223eec0745e177
6
+ metadata.gz: 6e70c1cd2aa695ee474e9950c5907937258174cb8887b22f828a23b208588f14b3655dff20a182abaaebb0cc7eeea331671713e0078b47f06696391edcf71982
7
+ data.tar.gz: 9b8c1cb87c59402765d6bc863b6cf30140cef421fc092b37a86b47a3de8552a3de49cf248373f0dc8995283184c918325cd117c46a98f2fc9f0b0556e2db5670
data/CHANGELOG.md CHANGED
@@ -1,48 +1,5 @@
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
-
32
- ### [0.1.9](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.8...v0.1.9) (2022-11-05)
33
-
34
-
35
- ### Bug Fixes
36
-
37
- * nameserverscloudinit ([506a8c6](https://www.github.com/STARTcloud/vagrant-zones/commit/506a8c69976a03efcc9f62388bbebfdabc870942))
38
-
39
- ### [0.1.8](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.7...v0.1.8) (2022-11-02)
40
-
41
-
42
- ### Bug Fixes
43
-
44
- * version fix ([5fa814e](https://www.github.com/STARTcloud/vagrant-zones/commit/5fa814eac5006344845616e065d49b68ba67326c))
45
-
46
3
  ### [0.1.7](https://www.github.com/STARTcloud/vagrant-zones/compare/v0.1.6...v0.1.7) (2022-11-02)
47
4
 
48
5
 
@@ -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, :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, :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
11
11
 
12
12
  # rubocop:enable Layout/LineLength
13
13
 
@@ -61,7 +61,6 @@ module VagrantPlugins
61
61
  @vagrant_user_private_key_path = './id_rsa'
62
62
  @xhci_enabled = 'off'
63
63
  @override = false
64
- @login_wait = 5
65
64
  @cloud_init_enabled = false
66
65
  @cloud_init_conf = 'on'
67
66
  @cloud_init_dnsdomain = nil
@@ -211,10 +211,13 @@ module VagrantPlugins
211
211
  end
212
212
 
213
213
  # This Sanitizes the DNS Records
214
- def dnsservers(uii, opts)
214
+ def dnsservers(uii)
215
215
  config = @machine.provider_config
216
- servers = opts['dns']
217
- servers = [{ 'nameserver' => '1.1.1.1' }, { 'nameserver' => '8.8.8.8' }] if opts['dns'].nil?
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?
218
221
  uii.info(I18n.t('vagrant_zones.nsservers') + servers.to_s) if config.debug
219
222
  servers
220
223
  end
@@ -267,7 +270,7 @@ module VagrantPlugins
267
270
  @machine.config.vm.networks.each do |_adaptertype, opts|
268
271
  responses = []
269
272
  nic_type = nictype(opts)
270
- if opts[:dhcp4] && opts[:managed]
273
+ if opts[:dhcp] && opts[:managed]
271
274
  vnic_name = "vnic#{nic_type}#{vtype(uii)}_#{config.partition_id}_#{opts[:nic_number]}"
272
275
  PTY.spawn("pfexec zlogin -C #{name}") do |zlogin_read, zlogin_write, pid|
273
276
  command = "ip -4 addr show dev #{vnic_name} | head -n -1 | tail -1 | awk '{ print $2 }' | cut -f1 -d\"/\" \n"
@@ -288,7 +291,7 @@ module VagrantPlugins
288
291
  end
289
292
  Process.kill('HUP', pid)
290
293
  end
291
- elsif (opts[:dhcp4] == false || opts[:dhcp4].nil?) && opts[:managed]
294
+ elsif (opts[:dhcp] == false || opts[:dhcp].nil?) && opts[:managed]
292
295
  ip = opts[:ip].to_s
293
296
  return nil if ip.empty?
294
297
 
@@ -505,13 +508,13 @@ module VagrantPlugins
505
508
  defrouter = opts[:gateway].to_s
506
509
  vnic_name = vname(uii, opts)
507
510
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
508
- servers = dnsservers(uii, opts)
511
+ servers = dnsservers(uii)
509
512
  ## Begin of code block to move to Netplan function
510
513
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic'))
511
514
  uii.info(" #{vnic_name}")
512
515
 
513
516
  netplan1 = %(network:\n version: 2\n ethernets:\n #{vnic_name}:\n match:\n macaddress: #{mac}\n)
514
- netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp4]}\n dhcp6: #{opts[:dhcp6]}\n)
517
+ netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp]}\n dhcp6: #{opts[:dhcp6]}\n)
515
518
  netplan3 = %( set-name: #{vnic_name}\n addresses: [#{ip}/#{shrtsubnet}]\n gateway4: #{defrouter}\n)
516
519
  netplan4 = %( nameservers:\n addresses: [#{servers[0]['nameserver']} , #{servers[1]['nameserver']}] )
517
520
  netplan = netplan1 + netplan2 + netplan3 + netplan4
@@ -530,7 +533,7 @@ module VagrantPlugins
530
533
  defrouter = opts[:gateway].to_s
531
534
  vnic_name = vname(uii, opts)
532
535
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
533
- servers = dnsservers(uii, opts)
536
+ servers = dnsservers(uii)
534
537
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic_dladm'))
535
538
  uii.info(" #{vnic_name}")
536
539
 
@@ -973,14 +976,10 @@ module VagrantPlugins
973
976
  uii.info(" #{ccip}") unless ccip.nil?
974
977
  execute(false, %(#{zcfg}"add attr; set name=password; set value=#{ccip}; set type=string; end;")) unless ccip.nil?
975
978
 
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?
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?
984
983
 
985
984
  ccisk = config.cloud_init_sshkey
986
985
  uii.info(I18n.t('vagrant_zones.setting_cloud_ssh_key')) unless ccisk.nil?
@@ -1062,13 +1061,13 @@ module VagrantPlugins
1062
1061
  zlogin(uii, 'rm -rf /etc/netplan/*.yaml')
1063
1062
  ip = ipaddress(uii, opts)
1064
1063
  vnic_name = vname(uii, opts)
1065
- servers = dnsservers(uii, opts)
1064
+ servers = dnsservers(uii)
1066
1065
  shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
1067
1066
  defrouter = opts[:gateway].to_s
1068
1067
  uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic'))
1069
1068
  uii.info(" #{vnic_name}")
1070
1069
  netplan1 = %(network:\n version: 2\n ethernets:\n #{vnic_name}:\n match:\n macaddress: #{mac}\n)
1071
- netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp4]}\n dhcp6: #{opts[:dhcp6]}\n)
1070
+ netplan2 = %( dhcp-identifier: mac\n dhcp4: #{opts[:dhcp]}\n dhcp6: #{opts[:dhcp6]}\n)
1072
1071
  netplan3 = %( set-name: #{vnic_name}\n addresses: [#{ip}/#{shrtsubnet}]\n gateway4: #{defrouter}\n)
1073
1072
  netplan4 = %( nameservers:\n addresses: [#{servers[0]['nameserver']} , #{servers[1]['nameserver']}] )
1074
1073
  netplan = netplan1 + netplan2 + netplan3 + netplan4
@@ -1176,20 +1175,20 @@ module VagrantPlugins
1176
1175
  if zlogin_read.expect(/#{alcheck}/)
1177
1176
  uii.info(I18n.t('vagrant_zones.automated-zlogin-user'))
1178
1177
  zlogin_write.printf("#{user(@machine)}\n")
1179
- sleep(config.login_wait)
1178
+ sleep(5)
1180
1179
  end
1181
1180
 
1182
1181
  if zlogin_read.expect(/#{pcheck}/)
1183
1182
  uii.info(I18n.t('vagrant_zones.automated-zlogin-pass'))
1184
1183
  zlogin_write.printf("#{vagrantuserpass(@machine)}\n")
1185
- sleep(config.login_wait)
1184
+ sleep(10)
1186
1185
  end
1187
1186
 
1188
1187
  zlogin_write.printf("\n")
1189
1188
  if zlogin_read.expect(/#{lcheck}/)
1190
1189
  uii.info(I18n.t('vagrant_zones.automated-zlogin-root'))
1191
1190
  zlogin_write.printf("sudo su\n")
1192
- sleep(config.login_wait)
1191
+ sleep(10)
1193
1192
  Process.kill('HUP', pid)
1194
1193
  end
1195
1194
  end
@@ -1253,7 +1252,7 @@ module VagrantPlugins
1253
1252
  def zoneniczloginsetup_windows(uii, opts, _mac)
1254
1253
  ip = ipaddress(uii, opts)
1255
1254
  vnic_name = vname(uii, opts)
1256
- servers = dnsservers(uii, opts)
1255
+ servers = dnsservers(uii)
1257
1256
  defrouter = opts[:gateway].to_s
1258
1257
  uii.info(I18n.t('vagrant_zones.configure_win_interface_using_vnic'))
1259
1258
  sleep(60)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module VagrantPlugins
4
4
  module ProviderZone
5
- VERSION = '0.1.12'
5
+ VERSION = '0.1.41'
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.12
4
+ version: 0.1.41
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-23 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n