(R)?ex the friendly automation framework



The Rex-1.8.0 release is now available on CPAN, adding initial support to manage Void Linux systems.


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:



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 » A word on backward compatibility

A word on backward compatibility

Everyone knows the pain if something gets deprecated and one have to port his old (and stable) code to a new version of a library or a framework. There is enough work to do instead of fixing code to work with newer versions of them.

So there is one premise new versions of Rex has to fulfill. They must be backward compatible.

I know this might be impossible in the one or other way, but to minimize this danger there is a thing called feature flags. If there is the need to break backward compatibility in favor of a new feature there will be a feature flag for this change. And only if this feature flag gets enabled in the Rexfile it will break compatibility.

So the default is always to be compatible.

If you have a problem that occurs after an update, it is considered as a bug. Please report this bug in our issue tracker.

Feature flags

This is the current list of feature flags:

Flag Since Description
no_task_chaining_cmdline_args 1.4 Disable per-task argument parsing
task_chaining_cmdline_args 1.4 Enable per-task argument parsing: rex --rex --args task1 --task1arg=value task2 --task2arg so task1 only gets task1arg and task2 only gets task2arg.
1.3 1.3 Activating the new template engine by default.
no_template_ng 1.3 Disabling the new template engine.
1.0 1.0 Disabling usage of a tty. This increases compatibility for remote execution. Furthermore, all features from earlier versions are activated.
no_autodie 1.0 Will disable autodie feature.
tty 1.0 Enable pty usage for ssh connections. (Default)
template_ng 0.56 Enabling the new template engine (better error reporting, etc.)
0.56 0.56 Will activate autodie feature. Furthermore, all features from earlier versions are activated.
autodie 0.56 Will enable autodie feature: die on all failed filesytem commands
0.55 0.55 Will activate using Net::OpenSSH by default if present. Furthermore, all features from earlier versions are activated.
0.54 0.54 Will activate checking services for existence before trying to manipulate them, and set() will overwrite already existing values (instead of concatenating). Furthermore, all features from earlier versions are activated.
0.53 0.53 Will activate register_cmdb_top_scope. And all things 0.51 and down activated.
register_cmdb_top_scope 0.53 Will register all cmdb top scope variables automatically in the templates.
0.51 0.51 Will load Rex::Constants and the CMDB by default. And all things 0.47 and down activated.
disable_taskname_warning 0.47 Disable warning about invalid task names (they should match /^[a-zA-Z_][a-zA-Z0-9_]*$/)
verbose_run 0.47 Explicitly output "Successfully executed" or "Error executing" messages for run() commands.
no_cache 0.46 Disable caching (like discovery results of remote OS, hardware, shell, etc.)
no_path_cleanup 0.44 Rex cleans the path before executing a command. With this feature Rex doesn't cleanup the path.
source_profile 0.44 Source $HOME/.profile before running a command.
source_global_profile 0.44 Source /etc/profile before running a command.
exec_autodie 0.44 If you execute a command with run() Rex will die() if the command returns a RETVAL != 0.
exec_and_sleep 0.43 Sometimes some commands that fork away didn't keep running. With this flag rex will wait a few ms before exiting the shell.
disable_strict_host_key_checking 0.43 Disabling strict host key checking for openssh connection mode.
reporting 0.43 Enable reporting
empty_groups 0.42 Enable usage of empty groups.
use_server_auth 0.42 Enable the usage of special authentication options for servers.
no_tty 0.41 Disable pty usage for ssh connections.
no_local_template_vars 0.40 Use global variables in templates
sudo_without_sh 0.40 Run sudo commands directly without the use of 'sh'. This might break things.
sudo_without_locales 0.40 Run sudo commands without locales. This will break things if you don't use English locales.
exit_status 0.39 This option tells Rex to return a non zero value on exit if a task fails.
0.35 0.35 This option enables the features of 0.31 and the possibility to call tasks as a functions without the need to use a hash reference for the parameters.
0.31 0.31 To enable special authentication options for a server group. This will overwrite the default authentication options for a task.

Howto enable Feature Flags

You can enable feature flags in your Rexfile with the following code:

# Rexfileuse Rex -feature => ['0.31'];

or even multiple ones like this:

# Rexfileuse Rex -feature => [qw(exec_autodie source_profile)];
Google Group / Twitter / GitHub / Mailinglist / irc.freenode.net #rex   -.ô.-   Disclaimer