(R)?ex Deployment & Configuration Management



adjust GmbH is sponsoring the (R)?ex project with a new build server. Thank you for your support!
(R)?ex 1.3.2 released, fixing issues related to file manipulation when run on BSDs. See the release notes for more details.
Read the second part of "Rex in practice" series about Test-driven infrastructure.
(R)?ex 1.3.1 released, fixing Rex::Commands::DB related tests.
repositor.io 1.1.0 released. repositor.io is a repository management tool for apt, yum, yast and docker. This is a bugfix release with fixes for ubuntu and centos7 installation media mirroring.
View the slides of the talk An introduction to Rex from Andy Beverley.


Talk Infrastructure as Code (ger) at German Perl Workshop.


2015-11-30/2015-12-01 (Karlsruhe)

Need Help?

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

Professional support is also available.

Release notes for 0.46

These are the changes in 0.46 release.

We want to thank all the people for contributing code and to fill bug reports. This helps making Rex better and better :)

Incompatible Changes

We're sorry, but this release comes with some incompatible changes. The most changes won't effect the majority of users, but we needed to change those things to fix some nasty things and to be more flexible in the future.

  • Reporting: The report format changed. The output and the internal API of the reporting interface changed. With this change we are more flexible for future improvements.
  • User module: We changed the creation of home directories to follow the policy of the target system.
  • Core: Caching is now active by default. This might break things if you're using chroot() inside a task, to change to another system. (For example to chroot from a debian system into a redhat system.)


With Rex::Test it is possible to test your Rexfile on a local VM before executing the code on your servers. Rex::Test uses Rex::Box to create the VM, but currently it only supports VirtualBox VMs.

To create a test just create a new file inside a t directory: t/base.t.

use Rex::Test::Base;
use Data::Dumper;
use Rex -base;

test {
  my $t = shift;

  $t->name("ubuntu test");

  $t->vm_auth(user => "root", password => "box");


  $t->has_content("/etc/passwd", qr{root:x:0:}ms);

  run "ls -l";
  $t->ok($? == 0, "ls -l returns success.");




Create clean development environments for your projects. Test your software in a production like environment.

With Rex/Boxes you can easily create your test environment with VirtualBox. You can use prebuild VM Images or roll your own. Read the quickstart guide to create your own environment in minutes.

  • This release brings support for KVM boxes. The KVM Rex::Box provider also allows the creation of Boxes on remote systems.

    # Rexfile
    set box => "KVM";
    # CALL:
    # rex init --name=gpw --url=http://domain.tld/ubuntu-server-12.10-amd64.qcow2
    desc "Initialize and start the VM: rex init --name=vmname [--url=http://...]";
    task "init", make {
      my $param = shift;
      box {
        my ($box) = @_;
        $box->name( $param->{name} );
        # where to download the base image
        $box->url( $param->{url} );
        # default is nat
          1 => {
            type => "nat",
          2 => {
            type   => "bridged",
            bridge => "br1",
        # define the authentication to the box
        # if you're downloading one from box.rexify.org this is the default.
          user     => "root",
          password => "box",
        # if you want to provision the machine,
        # you can define the tasks to do that


Changes in the Cloud API

  • Support for RackSpace via modules.

    • Authentication and endpoint.

      cloud_service "RackSpace";
      cloud_auth "user", "key";
      cloud_region "IAD";
    • Creating volumes and vms.

      my $vol_id = cloud_volume create => { size => 1, };
      my $instance = cloud_instance create => {
        image_id => "80fbcb55-b206-41f9-9bc2-2dd7aac6c061",
        name     => "myvm01",
        flavor   => "performance1-1",
        networks => ["a733f9d7-098e-4bf1-881d-5a91e84b44bb"];  # networks is optional
      cloud_volume attach => $vol_id,
          to => $instance>{id};
    • Terminating an instance and removing the volume.

      cloud_instance terminate => $instance>{id};
      cloud_volume delete => $vol_id;
  • fixed a case where amazon returns instance item in an array - Kasim Tuman
  • fixed multiple tags - David Golovan


  • Refactored report generation. This change break backward compatibility because the report format changed.


  • Caching is now enabled by default. This might break backward compatibility if you're using chroot() inside a task to chroot to another OS.

  • Allow passing template content to template command - #345 - reneeb

    file "/etc/file.cnf",
      content => template(\'<%= $name %> is cool!', name => 'Rex');
  • Added 'no_cache' feature. If you need to disable the cache, use this.

    # Rexfile
    use Rex -feature => ['no_cache'];
  • Added a special load path for perl libraries, so that we don't mix up perl and rex modules. (lib/perl)

  • Refactored handling of home directory creation. This might break compat. because we are following the system default now. (added create_home option) - #270 - FErki

  • CMDB path can now have variables / can be extended.

    # Rexfile
    use Rex::CMDB;
    set cmdb => {
      type => "YAML",
      path => [
  • Connect failure reports "Error running task/batch: Wrong username/password or wrong key" - #359 - eduardoj

  • Extended rexify command to work with git.

  • Added description to environments - #274

    # Rexfile
    desc "The live environment";
    environment live => sub {};
  • Added groups_dbi() function to generate server groups from sql - #346 - Jean-Marie RENOUARD

  • Added groups_yaml() function to generate server groups from yaml file - Jean-Marie RENOUARD

  • Add support for df on a given mount point - Simon Bertrang

  • Added authentication to download() function. - #340

    download "http://secured.location.tld/foo.tgz", "foo.tgz",
      user => "httpuser",
      password => "password";
  • Refactored tmp dir generation - FErki

comments powered by Disqus
Fork me on GitHub
Google Group / Twitter / GitHub / Mailinglist / irc.freenode.net #rex   -.รด.-   Disclaimer