vagrant-tart 0.0.5 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 216dc096ac1b18cb20713cb80c5688389f2503fe8d04954a1274406c35274fa1
4
- data.tar.gz: 89be7ac98b4980e0b59d6ff64d0b4160abbeb1b445ee2c58b171e771eb4ad208
3
+ metadata.gz: 1f6354db1d8746ea83a55aebde3987ecacb53015874ad76940b80237005a453f
4
+ data.tar.gz: fd5f3ac73ed084dea827d4eab5da7cf590bd90aab2b3a9cdb96a443398393176
5
5
  SHA512:
6
- metadata.gz: 9057828c27f9678e9a67fa684e479cd059fc4c108c71ed3c059762f8637485dde5a177a3fc7cf0507751f5a28c83c0230ed52254a76976a190520874f5ae5ec9
7
- data.tar.gz: 6d744163d2bdf101f0e56d6b7d806d78e3c7d7de1fb90fae1ad6e779cec94f15a563e52dd388a27ffe8664cd6c558f4485c506b29da829abe48bb462af6d04d6
6
+ metadata.gz: 6055b302f275ce263e5a190135b26c0d21b6c2bbac0495a870ac798d0ad0c3e06c73b9bd68a8e7cd76d8930f4762162057c902c7113a764399f959b6c6ed4365
7
+ data.tar.gz: a57e102f8e3773ad452ecb07635c1c6d724d0178a9a83f652fb70262b1d375b48f1ae9a1a9c21b9f339813716e589c56d647d110d1beab3e25dfc07b18982180
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024 Laurent Etiemble
3
+ Copyright (c) 2024-2025 Laurent Etiemble
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -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,8 @@ 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
+ ip_resolver = @machine.provider_config.ip_resolver
76
+ instance_ip = @machine.config.ssh.host || @driver.ip(@machine.provider_config.name, ip_resolver)
76
77
  rescue Errors::CommandError
77
78
  @logger.warn("Failed to read guest IP #{$ERROR_INFO}")
78
79
  end
@@ -92,6 +93,11 @@ module VagrantPlugins
92
93
  id = @machine.id.nil? ? "nil" : @machine.id
93
94
  "Tart[#{id}]"
94
95
  end
96
+
97
+ # Set the driver for the provider (used for testing).
98
+ def assing_driver(driver)
99
+ @driver = driver
100
+ end
95
101
  end
96
102
  end
97
103
  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}"
@@ -4,6 +4,6 @@ module VagrantPlugins
4
4
  # Top level module for the Tart provider plugin.
5
5
  module Tart
6
6
  # Current version of the Tart provider plugin.
7
- VERSION = "0.0.5"
7
+ VERSION = "0.0.7"
8
8
  end
9
9
  end
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.5
4
+ version: 0.0.7
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: 2024-11-09 00:00:00.000000000 Z
11
+ date: 2025-03-08 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.3.27
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: []