Class: Blimpy::Livery::CWD

Inherits:
Base
  • Object
show all
Defined in:
lib/blimpy/livery/cwd.rb

Direct Known Subclasses

Puppet

Instance Method Summary collapse

Methods inherited from Base

#can_rsync?, #dir_name, #livery_root, #postflight, #rsync_command, #rsync_excludes, #setup_on, #sync_to

Instance Method Details

#bootstrap_scriptObject



28
29
30
# File 'lib/blimpy/livery/cwd.rb', line 28

def bootstrap_script
  File.join(livery_root, script)
end

#flight(box) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/blimpy/livery/cwd.rb', line 18

def flight(box)
  run_sudo = 'sudo'

  unless use_sudo?(box)
    run_sudo = ''
  end

  box.ssh_into("cd #{dir_name} && #{run_sudo} BLIMPY_SHIPNAME=#{box.name} ./#{script}")
end

#preflight(box) ⇒ Object



10
11
12
# File 'lib/blimpy/livery/cwd.rb', line 10

def preflight(box)
  box.scp_file(bootstrap_script, dir_name)
end

#scriptObject



6
7
8
# File 'lib/blimpy/livery/cwd.rb', line 6

def script
  'bootstrap.sh'
end

#use_sudo?(box) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/blimpy/livery/cwd.rb', line 14

def use_sudo?(box)
  box.username != 'root'
end