vagrant-zones 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/vagrant-zones/config.rb +2 -1
- data/lib/vagrant-zones/driver.rb +15 -19
- data/lib/vagrant-zones/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b51ba5c43caff9de4276241efbdbbb266bc9f6b67578e828053d96248e83ce62
|
4
|
+
data.tar.gz: 906ac3a396962c04c1e1cce41f443bc04daa5af38430d4e3d6413855487bc1c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/vagrant-zones/config.rb
CHANGED
@@ -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, :
|
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
|
data/lib/vagrant-zones/driver.rb
CHANGED
@@ -211,13 +211,9 @@ module VagrantPlugins
|
|
211
211
|
end
|
212
212
|
|
213
213
|
# This Sanitizes the DNS Records
|
214
|
-
def dnsservers(uii)
|
215
|
-
|
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[:
|
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[:
|
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[:
|
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.
|
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[:
|
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(
|
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(
|
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(
|
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)
|
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.
|
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-
|
11
|
+
date: 2022-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|