(R)?ex the friendly automation framework



The Rex-1.7.1 release is now available on CPAN, fixing a Windows testing issue, and updating some docs.


The Rex-1.7.0 release is now available on CPAN.

Deprecating official Rex packages

As part of our efforts to simplify maintenance around RexOps projects, we have decided to stop building Rex packages on our side. We recommend relying on OS packages maintained by the various distributions in their respective upstream repositories, or to install Rex from CPAN.

Post-migration updates & clean-up

Over the course of the past weeks many clean-ups have been done, reaping the benefits provided by our new Statocles-based site:

New site engine for rexify.org

After months of work on a new site backend, we reached the MVP today for our site to be switched over to a new engine: from now on, our site will be maintained using the static site generator Statocles.



Need Help?

Rex is a pure open source project, you can find community support in the following places:

Professional support is also available.

» Home » Docs » Guides » Cheat Sheet

Cheat Sheet

Executing a command and parsing its output

run($command, %options)

Run a remote command and returns its output.


Example to just run a command if a file doesn't exists

⁠run "/tmp/install_service.sh", creates => "/opt/myservice/conf.xml";

Example to run a command and get its output

my @output_lines = run "df -h";

Installing and configuring a service

The most used functions in configuration management is installing/managing services and managing configuration files. In Rex you can do this with the file, pkg and service functions.

file($remote_file, %options)

Manage files on remote systems.


pkg($name, %options)

Install a package on the remote system.



Manage the state of a service.

This function can be called as a resource or as a normal function to directly stop/start/restart/... services.

Options (for calling as a resource)

Example for calling as resource

⁠service "nptd", ensure => "started";

Example for calling as function

⁠service ntpd => "restart";

Managing Cron

Manage cron jobs.

cron_entry($entry_name, %options)


Managing users and groups

Manage local user database.

account($user_name, %options)

Manage user accounts.


group($group_name, %options)

Manage groups.


Google Group / Twitter / GitHub / Mailinglist / irc.freenode.net #rex   -.ô.-   Disclaimer