lib/vagrant-hosts/config.rb in vagrant-hosts-2.6.2 vs lib/vagrant-hosts/config.rb in vagrant-hosts-2.7.0
- old
+ new
@@ -23,12 +23,30 @@
# provisioner on this VM will update all other running machines that
# use the hosts provisioner. This action will also occur on machine
# destruction. Defaults to `false`.
attr_accessor :sync_hosts
+ # @!attribute [rw] exports
+ # @return [Hash{String => Array<Array<String, Array<String>>>}]
+ # A hash containing named lists of `[address, [aliases]]` tuples
+ # that are exported by this VM. These exports can be collected by other
+ # VMs using the {#imports} option.
+ #
+ # @since 2.7.0
+ attr_accessor :exports
+
+ # @!attribute [rw] imports
+ # @return [Array<String>]
+ # A list of exports to collect from other VMs.
+ #
+ # @since 2.7.0
+ attr_accessor :imports
+
def initialize
@hosts = []
+ @exports = {}
+ @imports = []
@autoconfigure = UNSET_VALUE
@add_localhost_hostnames = UNSET_VALUE
@sync_hosts = UNSET_VALUE
end
@@ -49,10 +67,10 @@
add_host 'ff02::2', ['ip6-allrouters']
end
def finalize!
if @autoconfigure == UNSET_VALUE
- if @hosts.empty?
+ if @hosts.empty? && @imports.empty?
@autoconfigure = true
else
@autoconfigure = false
end
end