lib/vagrant-hosts/config.rb in vagrant-hosts-2.8.3 vs lib/vagrant-hosts/config.rb in vagrant-hosts-2.9.0

- old
+ new

@@ -39,17 +39,27 @@ # A list of exports to collect from other VMs. # # @since 2.7.0 attr_accessor :imports + # @!attribute [rw] change_hostname + # @return [TrueClass, FalseClass] When set to true, running the hosts + # provisioner on this VM will change the hostname of the machine to be + # the hostname configured or the name of the machine. + # Defaults to 'true'. + # + # @since 2.9.0 + attr_accessor :change_hostname + def initialize @hosts = [] @exports = {} @imports = [] @autoconfigure = UNSET_VALUE @add_localhost_hostnames = UNSET_VALUE @sync_hosts = UNSET_VALUE + @change_hostname = UNSET_VALUE end # Register a host for entry # # @param [String] address The IP address for aliases @@ -79,9 +89,10 @@ if @add_localhost_hostnames == UNSET_VALUE @add_localhost_hostnames = true end @sync_hosts = false if @sync_hosts == UNSET_VALUE + @change_hostname = true if @change_hostname == UNSET_VALUE end # @param other [VagrantHosts::Config] # @return [VagrantHosts::Config] The merged results def merge(other)