Sha256: 572c3cc3a1ad0e9dea7a3655d76fc46302c00a994ad42bd42752855ed409f3aa

Contents?: true

Size: 493 Bytes

Versions: 9

Compression:

Stored size: 493 Bytes

Contents

command :'exec host' do |c|
  c.summary = 'Execute a command in host'
  c.description = "Execute a command in host defined by DNS_name"
  c.syntax = 'ops exec host [host_name] "[command]"'
  c.example "", "ops exec host example.com 'docker ps -a'"
  c.action do |args, options|
    host = args[0]
    user = Ops::get_user_for(host)

    Net::SSH.start(host, user) do |ssh|
      Docker::containers_for(host).each do |container_name, config|
        ssh.exec args[1]
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
open-dock-0.0.10 lib/open-dock/commands/exec_host.rb
prun-ops-0.0.9 lib/prun-ops/commands/exec_host.rb
prun-ops-0.0.8 lib/prun-ops/commands/exec_host.rb
prun-ops-0.0.7 lib/prun-ops/commands/exec_host.rb
prun-ops-0.0.6 lib/prun-ops/commands/exec_host.rb
prun-ops-0.0.5 lib/prun-ops/commands/exec_host.rb
prun-ops-0.0.4 lib/prun-ops/commands/exec_host.rb
prun-ops-0.0.3 lib/prun-ops/commands/exec_host.rb
prun-ops-0.0.2 lib/prun-ops/commands/exec_host.rb