Skip to content
A framework to simplify systemadministration http://rexify.org/
Perl
Pull request Compare This branch is 3091 commits behind RexOps:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
debian
doc
lib
t
.gitignore
MANIFEST
MANIFEST.SKIP
Makefile.PL
README.pod

README.pod

(R)?ex is a small script to ease the execution of remote commands. You can write small tasks in a file named Rexfile.

Dependencies

Usage

A small example:

Rexfile

    use Rex::Commands::Run;
    use Rex::Commands::File;

    user "root";
    password "root";
    pass_auth;

    group "frontend" => "frontend[01..09]", "varnish[01..04]";

    
    desc "Show Unix version";
    task "uname", "server[1..9]", sub {
        run "uname -a";
    };

    desc "Write into a file";
    task "write", group => "frontend", sub {
        my $file = file_write '/tmp/status.out';
        $file->write("File created\n");
        $file->close;
    };

Commandline

  • Run commands directly from command line
        bash# rex -e 'run "uptime";' -H "frontend[01..10] middleware[01..05]" -u root -p password
  • List all known Tasks
        bash# rex -T
        Tasks
          uname                     Show Unix version
  • Run Task uname
        bash# rex uname
        Running task: uname
        Connecting to server1 (root)
        Linux mango 2.6.27-openvz-briullov.1-r4 #1 SMP Tue Nov 24 23:25:52 CET 2009 x86_64 Intel(R) Pentium(R) D CPU 2.80GHz GenuineIntel GNU/Linux
        Running task: uname
        Connecting to server2 (root)
        Linux debian01 2.6.26-2-amd64 #1 SMP Tue Aug 31 09:11:22 UTC 2010 x86_64 GNU/Linux
Something went wrong with that request. Please try again.