diff --git a/config/default.rb b/config/default.rb index fa08a4513..ed33be50c 100644 --- a/config/default.rb +++ b/config/default.rb @@ -1,6 +1,8 @@ Vagrant.configure("2") do |config| config.vagrant.host = :detect + config.ssh.forward_agent = false + config.ssh.forward_x11 = false config.ssh.guest_port = 22 config.ssh.keep_alive = true config.ssh.max_tries = 100 @@ -8,8 +10,6 @@ Vagrant.configure("2") do |config| config.ssh.shell = "bash -l" config.ssh.default.username = "vagrant" - config.ssh.default.forward_agent = false - config.ssh.default.forward_x11 = false config.vm.usable_port_range = (2200..2250) config.vm.box_url = nil diff --git a/plugins/kernel_v2/config/ssh.rb b/plugins/kernel_v2/config/ssh.rb index 515ff261a..6ed8ff5ff 100644 --- a/plugins/kernel_v2/config/ssh.rb +++ b/plugins/kernel_v2/config/ssh.rb @@ -5,6 +5,8 @@ require_relative "ssh_connect" module VagrantPlugins module Kernel_V2 class SSHConfig < SSHConnectConfig + attr_accessor :forward_agent + attr_accessor :forward_x11 attr_accessor :guest_port attr_accessor :keep_alive attr_accessor :max_tries @@ -16,6 +18,8 @@ module VagrantPlugins def initialize super + @forward_agent = UNSET_VALUE + @forward_x11 = UNSET_VALUE @guest_port = UNSET_VALUE @keep_alive = UNSET_VALUE @max_tries = UNSET_VALUE @@ -35,6 +39,8 @@ module VagrantPlugins def finalize! super + @forward_agent = false if @forward_agent == UNSET_VALUE + @forward_x11 = false if @forward_x11 == UNSET_VALUE @guest_port = nil if @guest_port == UNSET_VALUE @keep_alive = false if @keep_alive == UNSET_VALUE @max_tries = nil if @max_tries == UNSET_VALUE diff --git a/plugins/kernel_v2/config/ssh_connect.rb b/plugins/kernel_v2/config/ssh_connect.rb index ead9cfe48..36799d26a 100644 --- a/plugins/kernel_v2/config/ssh_connect.rb +++ b/plugins/kernel_v2/config/ssh_connect.rb @@ -1,16 +1,12 @@ module VagrantPlugins module Kernel_V2 class SSHConnectConfig < Vagrant.plugin("2", :config) - attr_accessor :forward_agent - attr_accessor :forward_x11 attr_accessor :host attr_accessor :port attr_accessor :private_key_path attr_accessor :username def initialize - @forward_agent = UNSET_VALUE - @forward_x11 = UNSET_VALUE @host = UNSET_VALUE @port = UNSET_VALUE @private_key_path = UNSET_VALUE @@ -18,8 +14,6 @@ module VagrantPlugins end def finalize! - @forward_agent = false if @forward_agent == UNSET_VALUE - @forward_x11 = false if @forward_x11 == UNSET_VALUE @host = nil if @host == UNSET_VALUE @port = nil if @port == UNSET_VALUE @private_key_path = nil if @private_key_path == UNSET_VALUE