News

2025年07月05日
Rex-1.16.1

Rex-1.16.1 is now available on CPAN.

It delivers bug fixes for hostgroup membership lists, executable discovery without which, and many others on BSDs and Solaris, including discovering memory usage details.

2025年02月05日
Rex-1.16.0

Rex-1.16.0 is now available on CPAN.

It now requires at least perl-5.14.4 to install, contains new features for running commands on Windows, and fixes bugs around git repository branch operations.

2024年11月05日
Rex-1.15.0

Happy 14th birthday, Rex!

Rex-1.15.0 is now available on CPAN. It contains several bug fixes and a few new features.

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.

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 0.12

Release notes for 0.12

Rex

  • Added sudo command

    sudo_password "mypassword";
task "dosomething", sub { say sudo "id"; };
  • Allow to manage multiple services at once.

    task "start", sub {
    service [qw/apache2 rsyslog ftp/] => "start";
    }; 
  • Added possibility to add and remove services from runlevels

    use Rex::Commands::Iptables;
    task "prepare", sub {
    service apache2 => "ensure", "started";
    service apache2 => "ensure", "stopped";
    }; 
  • Added an iptables module to manage basic iptables rules.

    task "firewall", sub {
    # clear all rules iptables_clear;
    # open port 22 on all devices open_port 22;
    # open port 22 and 80 on eth0 open_port [ 22, 80 ] => { dev => "eth0", };
    # close all ports on all devices close_port "all";
    # close port 22 on dev eth0 close_port 22 => { dev => "eth0", };
    # redirect port 80 to 10080 redirect_port 80 => 10080;
    # redirect port 80 to 10080 on eth0 redirect_port 80 => {
     dev => "eth0",
     to => 10080,
    };
    # set default state rules (RELATED,ESTABLISHED) to accept on all devices default_state_rule;
    # set default state rules (RELATED,ESTABLISHED) to accept on eth0 default_state_rule dev => "eth0";
    # make the system a nat gateway for its default route # this will set the sysctl entry net.ipv4.ip_forward to 1, too. is_nat_gateway;
    # define a custom iptables rule iptables t => "filter", A => "INPUT", i => "eth0", ...;
    }; 
  • Added Amazon EC2 Support

    use Data::Dumper;
    use Rex::Commands::Cloud;
user "root"; public_key "/path/to/your/ec2-public.key"; private_key "/path/to/your/ec2-private.key.pem";

# set the cloud service provider to "Amazon"cloud_service "Amazon";

# set cloud authcloud_auth "$access_key", "$secret_access_key";

# set cloud regioncloud_region "ec2.eu-west-1.amazonaws.com";

# define a group with all running ec2 instancesgroup ec2 => get_cloud_instances_as_group();

task "list", sub { print Dumper cloud_instances_list; print Dumper cloud_volume_list;

<span class="hljs-function">print</span> Dumper get_cloud_regions;
<span class="hljs-function">print</span> Dumper get_cloud_availability_zones;

};

task "create", sub {

<span class="hljs-comment"># if you want an ebs volume, create it. if not, you don't need this.</span><span class="hljs-comment">

my $vol_id = cloud_volume create => { size => 1, zone => "eu-west-1a"; };

<span class="hljs-comment"># create the cloud instances and attach the just created ebs volume.</span><span class="hljs-comment">

cloud_instance create => { image_id => "ami-02103876", name => "test-ec2", key => "my-test-key", volume => $vol_id, # if you don't have a volume, skip this zone => "eu-west-1a", # the volume and the instance must be in the same zone. skip this if you don't have a volume. }; };

task "destroy", sub { cloud_volume detach => "vol-xxaabb"; cloud_instance terminate => "i-ffgghhjj"; cloud_colume delete => "vol-xxaabb"; };

task "prepare", group => "ec2", sub { run "apt-get update"; install package => "apache2"; service apache2 => "start"; };

  • Some improvements and bug fixes

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

AltStyle によって変換されたページ (->オリジナル) /