2023-08-10 16:53:25 -04:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2012-04-18 01:12:27 -04:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
|
|
module VagrantPlugins
|
2012-06-14 21:49:20 -04:00
|
|
|
module Kernel_V1
|
2012-06-26 19:02:44 -04:00
|
|
|
class SSHConfig < Vagrant.plugin("1", :config)
|
2012-04-18 01:12:27 -04:00
|
|
|
attr_accessor :username
|
|
|
|
|
attr_accessor :password
|
|
|
|
|
attr_accessor :host
|
|
|
|
|
attr_accessor :port
|
|
|
|
|
attr_accessor :guest_port
|
|
|
|
|
attr_accessor :max_tries
|
|
|
|
|
attr_accessor :timeout
|
|
|
|
|
attr_accessor :private_key_path
|
|
|
|
|
attr_accessor :forward_agent
|
|
|
|
|
attr_accessor :forward_x11
|
2014-06-30 19:41:31 -04:00
|
|
|
attr_accessor :forward_env
|
2012-04-18 01:12:27 -04:00
|
|
|
attr_accessor :shell
|
|
|
|
|
|
2012-12-23 19:14:41 -05:00
|
|
|
def initialize
|
|
|
|
|
@username = UNSET_VALUE
|
|
|
|
|
@password = UNSET_VALUE
|
|
|
|
|
@host = UNSET_VALUE
|
|
|
|
|
@port = UNSET_VALUE
|
|
|
|
|
@guest_port = UNSET_VALUE
|
|
|
|
|
@max_tries = UNSET_VALUE
|
|
|
|
|
@timeout = UNSET_VALUE
|
|
|
|
|
@private_key_path = UNSET_VALUE
|
|
|
|
|
@forward_agent = UNSET_VALUE
|
|
|
|
|
@forward_x11 = UNSET_VALUE
|
2014-06-30 19:41:31 -04:00
|
|
|
@forward_env = UNSET_VALUE
|
2012-12-23 19:14:41 -05:00
|
|
|
@shell = UNSET_VALUE
|
|
|
|
|
end
|
2012-04-18 01:12:27 -04:00
|
|
|
|
2012-12-23 19:14:41 -05:00
|
|
|
def upgrade(new)
|
|
|
|
|
new.ssh.username = @username if @username != UNSET_VALUE
|
|
|
|
|
new.ssh.host = @host if @host != UNSET_VALUE
|
|
|
|
|
new.ssh.port = @port if @port != UNSET_VALUE
|
|
|
|
|
new.ssh.guest_port = @guest_port if @guest_port != UNSET_VALUE
|
|
|
|
|
new.ssh.private_key_path = @private_key_path if @private_key_path != UNSET_VALUE
|
|
|
|
|
new.ssh.forward_agent = @forward_agent if @forward_agent != UNSET_VALUE
|
|
|
|
|
new.ssh.forward_x11 = @forward_x11 if @forward_x11 != UNSET_VALUE
|
2014-06-30 19:41:31 -04:00
|
|
|
new.ssh.forward_env = @forward_env if @forward_env != UNSET_VALUE
|
2012-12-23 19:14:41 -05:00
|
|
|
new.ssh.shell = @shell if @shell != UNSET_VALUE
|
2012-04-18 01:12:27 -04:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|