(R)?ex the friendly automation framework

News

2023-08-05
Rex-1.14.3

Rex-1.14.3 is now available on CPAN. It contains bug fixes for local package installation, command existence checks, and Git tests.

2023-05-05
Rex-1.14.2

The Rex-1.14.2 release is now available on CPAN. It contains bug fixes for running local commands on Windows, cloning git repositories, and test suite fixes for the upcoming perl-5.38.0 release.

2023-03-17
Call for papers TPRC 2023

Dean Hamstead from the The Perl and Raku Foundation Marketing Committee has sent an invitation to present about Rex at TPRC 2023. I’m posting it here to increase visibility.

2023-03-05
Rex-1.14.1

The Rex-1.14.1 release is now available on CPAN. It contains bug fixes and documentation updates.

2023-02-05
Rex-1.14.0

The Rex-1.14.0 release is now available on CPAN. It contains improved Rexfile loading, documentation updates, and bumps the minimum required Perl version to 5.12.5.

Events

2021-03-08
Learning automation using Rex

Ferenc Erki (FErki) will be the guest of Gábor Szabó on the next Code Maven live stream to learn about automation using Rex. Register for the free event via Code Maven or Meetup, and join the discussion!

2020-03-05
Unexpected use cases with Rex

Unexpected use cases with Rex at the 22nd German Perl/Raku Workshop 2020 in Erlangen by Ferenc Erki (FErki).

2019-11-09
Rex & Friends

Rex & Friends talk at the Barcelona Perl & Friends 2019 by Ferenc Erki (FErki).

» Home » Docs » Release notes » Release notes for 1.4.0

Release notes for 1.4.0

This is a new minor release, adding new features, upgrade is recommended for all users.

As you may have noticed, the last release of Rex is around 6 months old. A lot has happened since then, and due to bigger internal changes, we wanted to be extra careful about the release, giving it as much time to bake as it needed.

The result is so far the biggest release of Rex, containing 4353 insertions and 1655 deletions happened to the lines of 118 files on 271 commits from 16 contributors, closing 93 PRs and 48 issues. To put it in perspective, this means ~30% of all files, and ~20% of all lines were touched in one way or another.

We couldn't have done this without the support of our fantastic community, keeping us busy with feedback, discussions both on- and offline, reporting issues, and sending pull requests. Thank you!

We are especially happy to have Eric Johnson (kablamo) to join the project as a new core developer. Most of the big things in this release were originally his ideas, and he was restless implementing them.

We would like to welcome H. Daniel Cesario, Harm Müller, Hiroki Matsuo, Jose Luis Perez Diez, Ken Crowell, Patrick Lauer, petersonchen, Prajithp as new contributors.

So as they say:

Good things come to those who wait

Highlights

New features

New Mkfs command

Now there's a dedicated Mkfs command, split out from LVM and partition handling modules, to deal with file system creation.

Improved argument parsing

As a preparation of another planned feature, it is now possible to pass arguments and CLI options to rex tasks, even if multiple ones are asked to be run. Please be aware this might not be a fully backwards compatible change for your use case. This feature is enabled by the 1.4 feature flag, but you can disable it with no_task_chaining_cmdline_args.

For example:

rex lib:task1 --option1=value1 lib:task2 --option2=value2
rex lib:task1 --option=value1 lib:task2 --option=value2
rex lib:task1 <arg> --option=value

New supported OSes

Managing Arch Linux is now supported via a completely new module, while Linux Mint and Raspbian are being recognized as Debian clones.

ParamLookup

Rex::Ext::ParamLookup from the RexOps/rex-recipes repository is now living in core as Rex::Helper::Rexfile::ParamLookup.

param_lookup is a command to manage task parameters.

my $var = param_lookup "param_name", "default_value";

First param_lookup checks the task parameters for param_name. If it's not found, it tries to look it up from CMDB (if CMDB is used). If it's still not found, it falls back to default_value. Additionally it registers the parameters as template values.

Summary output

Now there's a short summary displayed at the end of each run, containing success/failure info of the executed tasks. If there were any errors, they are listed by remote machine (ordered by hostname).

Firewall handling

There's a new firewall resource to manage firewall rules.

firewall "open-port-82-for-1.2.3.4",
  ensure => "present",
  action => "accept",
  port   => 82,
  source => "1.2.3.4";

The UFW firewall provider has been moved from rex-recipes to core too, and it is now available on top of the default iptables provider.

On top of that, IPv6 support has been added.

open_port, [ 22, 80 ];     # defaults to IPv4 rule
open_port - 4, [ 22, 80 ]; # IPv4 rule
open_port - 6, [ 22, 80 ]; # IPv6 rule

CMDB

Now CMDB can contain template code too.

Enhancements

Crontab handling

Unprivileged users can now manage their own crontabs.

Templates

Rexfile/module loading

The way of loading Rexfile and modules, has completely been refactored, making it easier to detect potential errors, and giving more useful feedback about them.

Guest VM options

Now it is possible to set CPU and memory options for (test) VMs.

Documentation

General

A bunch of general enhancements happened:

Full list of commits:

Bugfixes

Shared variables

Previously there was a race condition while using Rex::Shared::Var to share variables across tasks.

Templates

AWS handling

We now use AWS::Signature4 to talk to Amazon services.

Draining IO in parallel

The previous way to drain STDOUT/STEDERR output of a remote (or for that matter, local) connection proved to be, let's say suboptimal, leading to potential hangs, and other weirdness. This now has been fixed, moved to a common codebase, and we cover it with tests.

General

The reporting feature had some troubles when using bulk_install, so until a proper fix, Rex now simply falls back to sequential package installation as a workaround.

On top of that, the most notable bug fixes are realted to task hooks and continuous reading of output.

Full list of commits:

Proudly powered by Perl and built with Statocles

GitHub repository and discussions / Chat on Matrix and IRC / Mailing list on Google Groups (retired: rex-users@freelists)

MetaCPAN / Twitter / StackShare / Server Fault   -.ô.-   Disclaimer