Sha256: 44af1d48ba353ef7b6ab469ef2ef161f6059598868b9e0e63d7512df84641403
Contents?: true
Size: 767 Bytes
Versions: 11
Compression:
Stored size: 767 Bytes
Contents
require 'serverspec' require 'net/ssh' set :backend, :ssh if ENV['ASK_SUDO_PASSWORD'] begin require 'highline/import' rescue LoadError fail "highline is not available. Try installing it." end set :sudo_password, ask("Enter sudo password: ") { |q| q.echo = false } else set :sudo_password, ENV['SUDO_PASSWORD'] end host = ENV['TARGET_HOST'] options = Net::SSH::Config.for(host) options[:user] ||= ENV['TARGET_USER'] options[:port] ||= ENV['TARGET_PORT'] options[:keys] ||= ENV['TARGET_PRIVATE_KEY'] set :host, options[:host_name] || host set :ssh_options, options # Disable sudo # set :disable_sudo, true # Set environment variables # set :env, :LANG => 'C', :LC_MESSAGES => 'C' # Set PATH # set :path, '/sbin:/usr/local/sbin:$PATH'
Version data entries
11 entries across 11 versions & 1 rubygems