Sha256: d8a5ca88ff2809669dc58c33f2cf828763274f9eb20f7f952ae280a762496df4

Contents?: true

Size: 861 Bytes

Versions: 29

Compression:

Stored size: 861 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

set :request_pty, true

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
itamae-mitsurin-1.0.3 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-1.0.2 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-1.0.1 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-1.0.0 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.50 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.49 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.48 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.47 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.46 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.45 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.44 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.43 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.42 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.41 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.40 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.39 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.38 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.37 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.36 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.35 lib/itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb