lib/config_builder/model/ssh.rb in vagrant-config_builder-0.15.1 vs lib/config_builder/model/ssh.rb in vagrant-config_builder-1.0.0.rc1
- old
+ new
@@ -33,10 +33,14 @@
# port to port 22 on the guest from port 4567 on the host, Vagrant will
# attempt to use port 4567 to talk to the guest if there is no other
# option.
def_model_attribute :guest_port
+ # @!attribute [rw] keep_alive
+ # @return [Boolean]
+ def_model_attribute :keep_alive
+
# @!attribute [rw] private_key_path
# @return [String] The path to the private key to use to SSH into the guest
# machine. By default this is the insecure private key that ships with
# Vagrant, since that is what public boxes use. If you make your own
# custom box with a custom SSH key, this should point to that private
@@ -56,10 +60,15 @@
# @!attribute [rw] forward_x11
# @return [Boolean] If `true`, X11 forwarding over SSH connections is
# enabled. Defaults to `false`.
def_model_attribute :forward_x11
+ # @!attribute [rw] forward_env
+ # @return [Array<String>] An array of host environment variables to forward
+ # to the guest.
+ def_model_attribute :forward_env
+
# @!attribute [rw] insert_key
# @return [Boolean] If `true`, Vagrant will automatically insert an insecure
# keypair to use for SSH. By default, this is `true`. This only has an
# effect if you don't already use private keys for authentication.
def_model_attribute :insert_key
@@ -87,24 +96,33 @@
# the shell you get when you run `vagrant ssh`. This configuration option
# only affects the shell to use when executing commands internally in
# Vagrant.
def_model_attribute :shell
+ # @!attribute [rw] sudo_command
+ # @return [String] The command to use when executing a command with sudo.
+ # This defaults to `sudo -E -H %c`. The `%c` will be replaced by the
+ # command that is being executed.
+ def_model_attribute :sudo_command
+
def to_proc
Proc.new do |global_config|
ssh = global_config.ssh
- with_attr(:username) { |val| ssh.username = val }
- with_attr(:password) { |val| ssh.password = val }
- with_attr(:host) { |val| ssh.host = val }
- with_attr(:port) { |val| ssh.port = val }
- with_attr(:guest_port) { |val| ssh.guest_port = val }
+ with_attr(:username) { |val| ssh.username = val }
+ with_attr(:password) { |val| ssh.password = val }
+ with_attr(:host) { |val| ssh.host = val }
+ with_attr(:port) { |val| ssh.port = val }
+ with_attr(:guest_port) { |val| ssh.guest_port = val }
+ with_attr(:keep_alive) { |val| ssh.keep_alive = val }
with_attr(:private_key_path) { |val| ssh.private_key_path = val }
- with_attr(:forward_agent) { |val| ssh.forward_agent = val }
- with_attr(:forward_x11) { |val| ssh.forward_x11 = val }
- with_attr(:insert_key) { |val| ssh.insert_key = val }
- with_attr(:proxy_command) { |val| ssh.proxy_command = val }
- with_attr(:pty) { |val| ssh.pty = val }
- with_attr(:shell) { |val| ssh.shell = val }
+ with_attr(:forward_agent) { |val| ssh.forward_agent = val }
+ with_attr(:forward_x11) { |val| ssh.forward_x11 = val }
+ with_attr(:forward_env) { |val| ssh.forward_env = val }
+ with_attr(:insert_key) { |val| ssh.insert_key = val }
+ with_attr(:proxy_command) { |val| ssh.proxy_command = val }
+ with_attr(:pty) { |val| ssh.pty = val }
+ with_attr(:shell) { |val| ssh.shell = val }
+ with_attr(:sudo_command) { |val| ssh.sudo_command = val }
end
end
end