Class: Moonshot::SSHCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/moonshot/ssh_command.rb

Overview

A SSHCommand that is automatically registered with the Moonshot::CommandLine, including options for SSH access.

Direct Known Subclasses

Commands::Ssh

Instance Method Summary collapse

Methods inherited from Command

inherited

Instance Method Details

#parserObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/moonshot/ssh_command.rb', line 7

def parser
  parser = super
  parser.on('-l', '--user USER', 'User to log into remote machine as') do |v|
    Moonshot.config.ssh_config.ssh_user = v
  end

  parser.on('-i', '--identity-file FILE', 'SSH Private Key to authenticate with') do |v|
    Moonshot.config.ssh_config.ssh_identity_file = v
  end

  parser.on('-s', '--instance INSTANCE_ID', 'Specific AWS EC2 ID to connect through') do |v|
    Moonshot.config.ssh_instance = v
  end

  parser.on('-c', '--command COMMAND', 'Command to execute on the remote host') do |v|
    Moonshot.config.ssh_command = v
  end

  parser.on('-g', '--auto-scaling-group ASG_NAME',
            'The logical ID of the ASG to SSH into, required for multiple stacks') do |v|
    Moonshot.config.ssh_auto_scaling_group_name = v
  end
end