HammerCLIForeman::Command
# File lib/hammer_cli_foreman/ssh.rb, line 30 def execute puts _("About to execute: #{command} as user #{user}\n" + "on the following #{hosts.size} hosts: #{host_names.join(', ')}") unless prompt? == false || ask(_('Continue, (y/N)')).downcase == 'y' warn _('aborting per user request') return HammerCLI::EX_OK end ssh_options = { :user => user, :auth_methods => ['publickey'] } ssh_options[:keys] = [identity_file] unless identity_file.to_s.empty? Net::SSH::Multi.start(:on_error => :warn) do |session| targets.each { |s| session.use s, ssh_options } session.exec command session.loop end HammerCLI::EX_OK end
Generated with the Darkfish Rdoc Generator 2.