def connection_options(opts)
      connection_options = {
        logger:                 logger,
        user_known_hosts_file:  '/dev/null',
        hostname:               opts[:host],
        port:                   opts[:port],
        username:               opts[:user],
        compression:            opts[:compression],
        compression_level:      opts[:compression_level],
        keepalive:              opts[:keepalive],
        keepalive_interval:     opts[:keepalive_interval],
        timeout:                opts[:connection_timeout],
        connection_retries:     opts[:connection_retries],
        connection_retry_sleep: opts[:connection_retry_sleep],
        max_wait_until_ready:   opts[:max_wait_until_ready],
        auth_methods:           opts[:auth_methods],
        keys_only:              opts[:keys_only],
        keys:                   opts[:key_files],
        password:               opts[:password],
        forward_agent:          opts[:forward_agent],
        proxy_command:          opts[:proxy_command],
        bastion_host:           opts[:bastion_host],
        bastion_user:           opts[:bastion_user],
        bastion_port:           opts[:bastion_port],
        non_interactive:        opts[:non_interactive],
        transport_options:      opts,
      }
      # disable host key verification. The hash key and value to use
      # depends on the version of net-ssh in use.
      connection_options[verify_host_key_option] = verify_host_key_value(opts[:verify_host_key])

      connection_options
    end
def connection_options(opts)
      connection_options = {
        logger:                 logger,
        user_known_hosts_file:  '/dev/null',
        hostname:               opts[:host],
        port:                   opts[:port],
        username:               opts[:user],
        compression:            opts[:compression],
        compression_level:      opts[:compression_level],
        keepalive:              opts[:keepalive],
        keepalive_interval:     opts[:keepalive_interval],
        timeout:                opts[:connection_timeout],
        connection_retries:     opts[:connection_retries],
        connection_retry_sleep: opts[:connection_retry_sleep],
        max_wait_until_ready:   opts[:max_wait_until_ready],
        auth_methods:           opts[:auth_methods],
        keys_only:              opts[:keys_only],
        keys:                   opts[:key_files],
        password:               opts[:password],
        forward_agent:          opts[:forward_agent],
        proxy_command:          opts[:proxy_command],
        bastion_host:           opts[:bastion_host],
        bastion_user:           opts[:bastion_user],
        bastion_port:           opts[:bastion_port],
        non_interactive:        opts[:non_interactive],
        transport_options:      opts,
      }
      # disable host key verification. The hash key and value to use
      # depends on the version of net-ssh in use.
      connection_options[verify_host_key_option] = verify_host_key_value(opts[:verify_host_key])

      connection_options
    end
Builds the hash of options needed by the Connection object on
 construction.

 @param opts [Hash] merged configuration and mutable state data
 @return [Hash] hash of connection options
 @api private