Sha256: 7666cebaa5259dbbaf0c4b2bc4da2a39548ed34d8d296d746c509b5039ab2f44

Contents?: true

Size: 738 Bytes

Versions: 1

Compression:

Stored size: 738 Bytes

Contents

#encoding: utf-8
module Vagabond
  module Actions
    module SSH

      def _ssh
        name_required!
        if(lxc.exists?)
          if(lxc.running?)
            key_path = setup_key!
            ui.info "#{ui.color('Vagabond:', :bold)} SSH connect to: #{ui.color(name, :cyan)}"
            command = ["#{options[:sudo]}ssh root@#{lxc.container_ip(10, true)} -i #{Settings[:ssh_key]} -oStrictHostKeyChecking=no"]
            if(@leftover_args)
              command << "\"#{@leftover_args.join(' ')}\""
            end
            exec command.join(' ')
          else
            ui.error "Node not running: #{name}"
          end
        else
          ui.error "Node not created: #{name}"
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagabond-0.2.10 lib/vagabond/actions/ssh.rb