Sha256: 1f29f549109e7f09b3ad85d2683a3ad472f01df236a42435a57abde887da664d
Contents?: true
Size: 571 Bytes
Versions: 9
Compression:
Stored size: 571 Bytes
Contents
module OdaniaOps module Cli class Node < Thor desc 'exec <command>', 'Run command on nodes' option :hosts, :type => :string, :aliases => [:h], :required => true option :process, :type => :string, :default => :sequence, :banner => 'Process in sequence or parallel' def exec(*args) command = args.join(' ') on options[:hosts].split(','), in: options[:process].to_sym do |host| within '/tmp' do result = capture command result.split("\n").each do |line| info "#{host}: #{line}" end end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems