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

Version Path
odania_ops-0.0.14 lib/odania_ops/cli/node.rb
odania_ops-0.0.13 lib/odania_ops/cli/node.rb
odania_ops-0.0.12 lib/odania_ops/cli/node.rb
odania_ops-0.0.11 lib/odania_ops/cli/node.rb
odania_ops-0.0.10 lib/odania_ops/cli/node.rb
odania_ops-0.0.9 lib/odania_ops/cli/node.rb
odania_ops-0.0.8 lib/odania_ops/cli/node.rb
odania_ops-0.0.7 lib/odania_ops/cli/node.rb
odania_ops-0.0.6 lib/odania_ops/cli/node.rb