vagrant-tart 0.0.5 → 0.0.6
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/LICENSE +1 -1
- data/lib/vagrant-tart/config.rb +28 -0
- data/lib/vagrant-tart/provider.rb +1 -1
- data/lib/vagrant-tart/util/driver.rb +5 -2
- data/lib/vagrant-tart/version.rb +1 -1
- data/locales/en.yml +8 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0f4e5c9e706e7f97e6abfb4a14b15477e34f8519f90940e93918bbc9f766485
|
4
|
+
data.tar.gz: 61048e9ab2d365476cae641b2d5757bf61ee90d665871a86cd0dc17ce34ec12e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92a51146a0d799256bef1adea44b0d018d77ca6f7e0d343922f0537a4eef6c32540dc942237aede874289b6d0df447de499397d890adccfd25fbfec6fbc59616
|
7
|
+
data.tar.gz: 106b2e9c056910a45d290cf977dfa3395cfd766f249f7b1054b4000b297bf275d88860fddb81d68121410dd1e01ec4fdb197816a697def4e9063addb65a1abdf
|
data/LICENSE
CHANGED
data/lib/vagrant-tart/config.rb
CHANGED
@@ -23,6 +23,10 @@ module VagrantPlugins
|
|
23
23
|
|
24
24
|
# @return [Boolean] Show a GUI window on boot, or run headless
|
25
25
|
attr_accessor :gui
|
26
|
+
# @return [Boolean] Whether the audio of the machine passes through the host
|
27
|
+
attr_accessor :audio
|
28
|
+
# @return [Boolean] Whether the machine and the host share the clipboard
|
29
|
+
attr_accessor :clipboard
|
26
30
|
# @return [Integer] Number of CPUs
|
27
31
|
attr_accessor :cpus
|
28
32
|
# @return [Integer] Memory size in MB
|
@@ -37,6 +41,10 @@ module VagrantPlugins
|
|
37
41
|
attr_accessor :vnc
|
38
42
|
# @return [Boolean] Whether the machine expose a VNC server (virtualization framework)
|
39
43
|
attr_accessor :vnc_experimental
|
44
|
+
# @return [String] The IP resolver to use (default to 'dhcp')
|
45
|
+
attr_accessor :ip_resolver
|
46
|
+
# @return [Array<String>] Extra arguments to pass to the tart run command
|
47
|
+
attr_accessor :extra_run_args
|
40
48
|
|
41
49
|
# @return [Array<String>] List of volumes to mount
|
42
50
|
attr_accessor :volumes
|
@@ -53,6 +61,8 @@ module VagrantPlugins
|
|
53
61
|
@name = UNSET_VALUE
|
54
62
|
|
55
63
|
@gui = UNSET_VALUE
|
64
|
+
@audio = UNSET_VALUE
|
65
|
+
@clipboard = UNSET_VALUE
|
56
66
|
@cpus = UNSET_VALUE
|
57
67
|
@memory = UNSET_VALUE
|
58
68
|
@disk = UNSET_VALUE
|
@@ -60,6 +70,8 @@ module VagrantPlugins
|
|
60
70
|
@suspendable = UNSET_VALUE
|
61
71
|
@vnc = UNSET_VALUE
|
62
72
|
@vnc_experimental = UNSET_VALUE
|
73
|
+
@ip_resolver = UNSET_VALUE
|
74
|
+
@extra_run_args = UNSET_VALUE
|
63
75
|
|
64
76
|
@volumes = []
|
65
77
|
end
|
@@ -74,6 +86,8 @@ module VagrantPlugins
|
|
74
86
|
@name = nil if @name == UNSET_VALUE
|
75
87
|
|
76
88
|
@gui = false if @gui == UNSET_VALUE
|
89
|
+
@audio = false if @audio == UNSET_VALUE
|
90
|
+
@clipboard = false if @clipboard == UNSET_VALUE
|
77
91
|
@cpus = 1 if @cpus == UNSET_VALUE
|
78
92
|
@memory = 1024 if @memory == UNSET_VALUE
|
79
93
|
@disk = 10 if @disk == UNSET_VALUE
|
@@ -81,6 +95,8 @@ module VagrantPlugins
|
|
81
95
|
@suspendable = false if @suspendable == UNSET_VALUE
|
82
96
|
@vnc = false if @vnc == UNSET_VALUE
|
83
97
|
@vnc_experimental = false if @vnc_experimental == UNSET_VALUE
|
98
|
+
@ip_resolver = "dhcp" if @ip_resolver == UNSET_VALUE
|
99
|
+
@extra_run_args = [] if @extra_run_args == UNSET_VALUE
|
84
100
|
end
|
85
101
|
|
86
102
|
# Validate the configuration
|
@@ -94,6 +110,12 @@ module VagrantPlugins
|
|
94
110
|
# Check that the GUI flag is a valid boolean
|
95
111
|
errors << I18n.t("vagrant_tart.config.gui_invalid") unless @gui == true || @gui == false
|
96
112
|
|
113
|
+
# Check that the audio flag is a valid boolean
|
114
|
+
errors << I18n.t("vagrant_tart.config.audio_invalid") unless @audio == true || @audio == false
|
115
|
+
|
116
|
+
# Check that the clipboard flag is a valid boolean
|
117
|
+
errors << I18n.t("vagrant_tart.config.clipboard_invalid") unless @clipboard == true || @clipboard == false
|
118
|
+
|
97
119
|
# Check that CPUs is a valid number and between 1 and the maximum available CPUs
|
98
120
|
max_cpus = Etc.nprocessors
|
99
121
|
unless (@cpus.is_a? Integer) && @cpus >= 1 && @cpus <= max_cpus
|
@@ -126,6 +148,12 @@ module VagrantPlugins
|
|
126
148
|
# Check that the VNC and VNC experimental flags are not both true
|
127
149
|
errors << I18n.t("vagrant_tart.config.vnc_exclusive") if @vnc == true && @vnc_experimental == true
|
128
150
|
|
151
|
+
# Check that the IP resolver is a valid string (either 'dhcp' or 'arp')
|
152
|
+
errors << I18n.t("vagrant_tart.config.ip_resolver_invalid") unless %w[dhcp arp].include? @ip_resolver
|
153
|
+
|
154
|
+
# Check that the extra run arguments is an array of strings
|
155
|
+
errors << I18n.t("vagrant_tart.config.extra_run_args_invalid") unless @extra_run_args.is_a? Array
|
156
|
+
|
129
157
|
{ "Tart Provider" => errors }
|
130
158
|
end
|
131
159
|
|
@@ -72,7 +72,7 @@ module VagrantPlugins
|
|
72
72
|
# Retrieve the IP address
|
73
73
|
instance_ip = nil
|
74
74
|
begin
|
75
|
-
instance_ip = @driver.ip(@machine.provider_config.name)
|
75
|
+
instance_ip = @driver.ip(@machine.provider_config.name, @machine.provider_config.ip_resolver)
|
76
76
|
rescue Errors::CommandError
|
77
77
|
@logger.warn("Failed to read guest IP #{$ERROR_INFO}")
|
78
78
|
end
|
@@ -67,8 +67,8 @@ module VagrantPlugins
|
|
67
67
|
# Execute the 'ip' commanda and returns the IP address of the machine.
|
68
68
|
# @param name [String] The name of the machine
|
69
69
|
# @return [String] The IP address of the machine
|
70
|
-
def ip(name)
|
71
|
-
cmd = ["tart", "ip", name]
|
70
|
+
def ip(name, ip_resolver)
|
71
|
+
cmd = ["tart", "ip", "--resolver", ip_resolver, name]
|
72
72
|
result = execute(*cmd)
|
73
73
|
result.strip
|
74
74
|
end
|
@@ -118,9 +118,12 @@ module VagrantPlugins
|
|
118
118
|
|
119
119
|
cmd = [script_path.to_s, name]
|
120
120
|
cmd << "--no-graphics" unless config.gui
|
121
|
+
cmd << "--no-audio" unless config.audio
|
122
|
+
cmd << "--no-clipboard" unless config.clipboard
|
121
123
|
cmd << "--suspendable" if config.suspendable?
|
122
124
|
cmd << "--vnc" if config.vnc
|
123
125
|
cmd << "--vnc-experimental" if config.vnc_experimental
|
126
|
+
cmd.concat(config.extra_run_args)
|
124
127
|
|
125
128
|
config.volumes.each do |volume|
|
126
129
|
cmd << "--dir=#{volume}"
|
data/lib/vagrant-tart/version.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -1,16 +1,24 @@
|
|
1
1
|
en:
|
2
2
|
vagrant_tart:
|
3
3
|
config:
|
4
|
+
audio_invalid: |-
|
5
|
+
Configuration must specify a valid audio setting (true or false)
|
6
|
+
clipboard_invalid: |-
|
7
|
+
Configuration must specify a valid clipboard setting (true or false)
|
4
8
|
cpus_invalid: |-
|
5
9
|
Configuration must specify a valid CPUs count (between 1 and %{max_cpus})
|
6
10
|
disk_invalid: |-
|
7
11
|
Configuration must specify a valid disk size (greater than 1 GB)
|
8
12
|
display_invalid: |-
|
9
13
|
Configuration must specify a valid display size (WIDTHxHEIGHT pixels)
|
14
|
+
extra_run_args_invalid: |-
|
15
|
+
Configuration must specify a valid extra run arguments (array of strings)
|
10
16
|
gui_invalid: |-
|
11
17
|
Configuration must specify a valid GUI setting (true or false)
|
12
18
|
image_required: |-
|
13
19
|
Configuration must specify an image
|
20
|
+
ip_resolver_arp_invalid: |-
|
21
|
+
Configuration must specify a valid IP resolver ARP setting (true or false)
|
14
22
|
memory_invalid: |-
|
15
23
|
Configuration must specify a valid memory size (between 1 and %{max_memory} MB)
|
16
24
|
name_required: |-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-tart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurent Etiemble
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Allows Vagrant to manage Tart virtual machines.
|
14
14
|
email:
|
@@ -55,7 +55,7 @@ metadata:
|
|
55
55
|
source_code_uri: https://github.com/letiemble/vagrant-tart
|
56
56
|
changelog_uri: https://github.com/letiemble/vagrant-tart/blob/main/CHANGELOG.md
|
57
57
|
rubygems_mfa_required: 'true'
|
58
|
-
post_install_message:
|
58
|
+
post_install_message:
|
59
59
|
rdoc_options: []
|
60
60
|
require_paths:
|
61
61
|
- lib
|
@@ -70,8 +70,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
|
-
rubygems_version: 3.
|
74
|
-
signing_key:
|
73
|
+
rubygems_version: 3.5.11
|
74
|
+
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: Vagrant Tart provider
|
77
77
|
test_files: []
|