Class: Vagrant::Config::SSHConfig
- Defined in:
- lib/vagrant/config/ssh.rb
Instance Attribute Summary collapse
-
#forward_agent ⇒ Object
Returns the value of attribute forward_agent.
-
#forward_x11 ⇒ Object
Returns the value of attribute forward_x11.
-
#forwarded_port_key ⇒ Object
Returns the value of attribute forwarded_port_key.
-
#host ⇒ Object
Returns the value of attribute host.
-
#max_tries ⇒ Object
Returns the value of attribute max_tries.
- #private_key_path ⇒ Object
-
#sudo_shell ⇒ Object
Returns the value of attribute sudo_shell.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#username ⇒ Object
Returns the value of attribute username.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ SSHConfig
constructor
A new instance of SSHConfig.
- #validate(errors) ⇒ Object
Methods inherited from Base
configures, #env, #instance_variables_hash, json_create, #set_options, #to_hash, #to_json
Constructor Details
#initialize ⇒ SSHConfig
Returns a new instance of SSHConfig.
16 17 18 |
# File 'lib/vagrant/config/ssh.rb', line 16 def initialize @sudo_shell = "bash" end |
Instance Attribute Details
#forward_agent ⇒ Object
Returns the value of attribute forward_agent.
12 13 14 |
# File 'lib/vagrant/config/ssh.rb', line 12 def forward_agent @forward_agent end |
#forward_x11 ⇒ Object
Returns the value of attribute forward_x11.
13 14 15 |
# File 'lib/vagrant/config/ssh.rb', line 13 def forward_x11 @forward_x11 end |
#forwarded_port_key ⇒ Object
Returns the value of attribute forwarded_port_key.
8 9 10 |
# File 'lib/vagrant/config/ssh.rb', line 8 def forwarded_port_key @forwarded_port_key end |
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/vagrant/config/ssh.rb', line 7 def host @host end |
#max_tries ⇒ Object
Returns the value of attribute max_tries.
9 10 11 |
# File 'lib/vagrant/config/ssh.rb', line 9 def max_tries @max_tries end |
#private_key_path ⇒ Object
20 21 22 |
# File 'lib/vagrant/config/ssh.rb', line 20 def private_key_path File.(@private_key_path, env.root_path) end |
#sudo_shell ⇒ Object
Returns the value of attribute sudo_shell.
14 15 16 |
# File 'lib/vagrant/config/ssh.rb', line 14 def sudo_shell @sudo_shell end |
#timeout ⇒ Object
Returns the value of attribute timeout.
10 11 12 |
# File 'lib/vagrant/config/ssh.rb', line 10 def timeout @timeout end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/vagrant/config/ssh.rb', line 6 def username @username end |
Instance Method Details
#validate(errors) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/vagrant/config/ssh.rb', line 24 def validate(errors) [:username, :host, :forwarded_port_key, :max_tries, :timeout, :private_key_path].each do |field| errors.add(I18n.t("vagrant.config.common.error_empty", :field => field)) if !instance_variable_get("@#{field}".to_sym) end errors.add(I18n.t("vagrant.config.ssh.private_key_missing", :path => private_key_path)) if !File.file?(private_key_path) end |