Sha256: f09b646dbb2f51b00471b1bd6a1e4b61a78877b1cad0f08801f91895d2028f86

Contents?: true

Size: 837 Bytes

Versions: 105

Compression:

Stored size: 837 Bytes

Contents

require 'serverspec'
require 'net/ssh'
require 'specinfra/helper/set'
require 'json'
include Specinfra::Helper::Set

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']
node_file = ENV['NODE_FILE']
attributes = JSON.parse(File.read(node_file), symbolize_names: true)
set_property attributes

options = Net::SSH::Config.for(host)
options[:user] = ENV['SSH_USER']
options[:password] = ENV['SSH_PASSWORD']
options[:keys] = ENV['SSH_KEY']
options[:port] = ENV['SSH_PORT']

set :host, options[:host_name] || host
set :shell, '/bin/bash'
set :ssh_options, options

Version data entries

105 entries across 44 versions & 1 rubygems

Version Path
itamae-mitsurin-0.8 test_project/spec/spec_helper.rb
itamae-mitsurin-0.7 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.7 test_project/spec/spec_helper.rb
itamae-mitsurin-0.7 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.4 lib/itamae/mitsurin/creators/templates/project/spec/spec_helper.rb