Module: RemoteLXC::Helpers

Included in:
RemotelxcCreate, RemotelxcDelete, RemotelxcInfo, RemotelxcList
Defined in:
lib/knife-remotelxc/helpers.rb

Instance Method Summary collapse

Instance Method Details

#knife_ssh(addr, command, args = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/knife-remotelxc/helpers.rb', line 3

def knife_ssh(addr, command, args={})
  cmd = "ssh -o StrictHostKeyChecking=no #{"{config[:lxc_ssh_user]}@" if config[:lxc_ssh_user]}#{addr} #{command}"
  so = Mixlib::ShellOut.new(cmd,
    :logger => Chef::Log.logger,
    :live_stream => $stdout
  ).run_command
  so.error!
  so
end