.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Rex 3pm" .TH Rex 3pm "2018-02-01" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Rex \- Remote Execution .SH "DESCRIPTION" .IX Header "DESCRIPTION" Rex is a command line tool which executes commands on remote servers. Define tasks in Perl and execute them on remote servers or groups of servers. .PP Rex can be used to: .IP "\(bu" 4 Deploy web applications to servers sequentially or in parallel. .IP "\(bu" 4 Automate common tasks. .IP "\(bu" 4 Provision servers using Rex's builtin tools. .PP You can find examples and howtos on .SH "GETTING HELP" .IX Header "GETTING HELP" .IP "\(bu" 4 Web Site: .IP "\(bu" 4 \&\s-1IRC:\s0 irc.freenode.net #rex .IP "\(bu" 4 Bug Tracker: .IP "\(bu" 4 Twitter: .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& # In a Rexfile: \& use Rex \-feature => [qw/1.3/]; \& \& user "root"; \& password "ch4ngem3"; \& \& desc "Show Unix version"; \& task "uname", sub { \& say run "uname \-a"; \& }; \& \& 1; \& \& # On the command line: \& bash# rex \-H server[01..10] uname .Ve .PP See rex for more information about how to use rex on the command line. .PP See Rex::Commands for a list of all commands you can use. .SH "CLASS METHODS" .IX Header "CLASS METHODS" .SS "get_current_connection" .IX Subsection "get_current_connection" This function is deprecated since 0.28! See Rex::Commands::connection. .PP Returns the current connection as a hashRef. .IP "server" 4 .IX Item "server" The server name .IP "ssh" 4 .IX Item "ssh" 1 if it is a ssh connection, 0 if not. .SS "is_ssh" .IX Subsection "is_ssh" Returns 1 if the current connection is a ssh connection. 0 if not. .SS "is_local" .IX Subsection "is_local" Returns 1 if the current connection is local. Otherwise 0. .SS "is_sudo" .IX Subsection "is_sudo" Returns 1 if the current operation is executed within sudo. .SS "get_sftp" .IX Subsection "get_sftp" Returns the sftp object for the current ssh connection. .SS "connect" .IX Subsection "connect" Use this function to create a connection if you use Rex as a library. .PP .Vb 3 \& use Rex; \& use Rex::Commands::Run; \& use Rex::Commands::Fs; \& \& Rex::connect( \& server => "remotehost", \& user => "root", \& password => "f00b4r", \& private_key => "/path/to/private/key/file", \& public_key => "/path/to/public/key/file", \& ); \& \& if(is_file("/foo/bar")) { \& print "Do something...\en"; \& } \& \& my $output = run("uptime"); .Ve .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Many thanks to the contributors for their work. Please see \s-1CONTRIBUTORS\s0 file for a complete list. .SH "LICENSE" .IX Header "LICENSE" Rex is a free software, licensed under: The Apache License, Version 2.0, January 2004