(R)?ex Deployment & Configuration Management

Search

News

2015-06-22
adjust GmbH is sponsoring the (R)?ex project with a new build server. Thank you for your support!
2015-06-17
(R)?ex 1.3.2 released, fixing issues related to file manipulation when run on BSDs. See the release notes for more details.
2015-06-09
Read the second part of "Rex in practice" series about Test-driven infrastructure.
2015-06-08
(R)?ex 1.3.1 released, fixing Rex::Commands::DB related tests.
2015-05-09
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.
2015-03-27
View the slides of the talk An introduction to Rex from Andy Beverley.

Conferences

2015-05-07
Talk Infrastructure as Code (ger) at German Perl Workshop.

Training

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.

Why use Rex?

  • If you have to do a task more than once, automate it!
  • Don‘t forget an installation step anymore.
  • Automation reduces the risk of failure, and lets you do your real work.

Advantages

  • Uses SSH, no agent required
  • Seamless integration, no conflicts
  • Easy to use and extend
  • Easy to learn, it‘s just plain Perl

Open source

We believe in the idea of open source. So Rex, and all its parts are released under the Apache 2.0 license.

You‘re invited to join the community to make Rex better and better.

Uptime?

This command line example will execute uptime on all the given hosts (frontend01, frontend02, ..., db04).

$ rex -H 'frontend[01..15] middleware[01..05] db[01..04]' -e 'say run "uptime"'

The same, but with a Rexfile

use Rex -feature => ['1.0'];

desc 'Get uptime';
task 'uptime', sub {
   say run 'uptime';
};

Now you can run your task with this command:

$ rex -H 'frontend[01..15] middleware[01..05] db[01..04]' uptime

Keep your configuration in sync

This example will install the Apache webserver on 5 machines, and keep their configuration in sync. If the deployed configuration file changes, it will automatically reload the service.

If this task gets executed against a "virgin" host (where no Apache is installed yet), it will first install it.

use Rex -feature => ['1.0'];

user 'root';
group frontend => 'frontend[01..05]';

desc 'Prepare frontend server';
task 'prepare', group => 'frontend', sub {
  pkg 'apache2',
    ensure => 'present';

  service 'apache2',
    ensure => 'started';
};

desc 'Keep configuration in sync';
task 'configure', group => 'frontend', sub {
  needs 'prepare';

  file '/etc/apache2/apache2.conf',
    source    => 'files/etc/apache2/apache2.conf',
    on_change => sub { service apache2 => 'reload'; };
};

Using sudo?

You can also run everything with sudo. Just define the sudo password and activate this mode.

use Rex -feature => ['1.0'];

user 'ubuntu';
group frontend => 'frontend[01..05]';
sudo TRUE;
sudo_password 'mysudopw';

desc 'Prepare frontend servers';
task 'prepare', group => 'frontend', sub {
  pkg 'apache2',
    ensure => 'latest';

  service 'apache2',
    ensure => 'started';
};

desc 'Keep configuration in sync';
task 'configure', group => 'frontend', sub {
  needs 'prepare';

  file '/etc/apache2/apache2.conf',
    source    => 'files/etc/apache2/apache2.conf',
    on_change => sub { service apache2 => 'reload'; };
};
comments powered by Disqus
Fork me on GitHub
Google Group / Twitter / GitHub / Mailinglist / irc.freenode.net #rex   -.ô.-   Disclaimer