» Home » Docs » Release notes » Release notes for 0.41
Release notes for 0.41
Common
Function to get the last output of a command that uses run() #104
task "prepare", "mysystem01", sub { install "ntp"; say last_command_output; };
Refactored Cron module, added environment variable support to cron
task "prepare", "mysystem01", sub { my @env = cron env => user => list; cron env => user => add => { MYVAR => "foo", }; cron env => user => delete => "MYVAR"; };
New sync module
This module doesn't use rsync, so it works with sudo and Windows, too. And it is also possible to use it with templates. If a file should be used as a template, you have to name it somefile.ext.tpl.
task "prepare", "mysystem01", sub {
# upload directory recursively to remote system.
sync_up "/local/directory", "/remote/directory";
sync_up "/local/directory", "/remote/directory", {
# setting custom file permissions for every file
files => {
owner => "foo",
group => "bar",
mode => 600,
},
# setting custom directory permissions for every directory
directories => {
owner => "foo",
group => "bar",
mode => 700,
},
};
# download a directory recursively from the remote system to the local machine
sync_down "/remote/directory", "/local/directory";
};
- added Hardware::VirtInfo module #119 - Franky Van Liedekerke
To get a list of all returned information:
use Data::Dumper;
my %hw_info = Rex::Hardware->get(qw/VirtInfo/);
print Dumper( \%hw_info );
To get the hypervisor:
task "info", "mysystem01", sub {
my %hw_info = Rex::Hardware->get(qw/VirtInfo/);
say "Role: " . $hw_info{VirtInfo}->{virtualization_role};
say "Type: " . $hw_info{VirtInfo}->{virtualization_type};
};
new keyword "case"
task "prepare", "myserver01", sub { my $package = case operating_system, { Debian => "vim", CentOS => "vim-enhanced", default => "vim", }; install $package; };
Refactored net_ssh2_exec() function - Peter H. Ezetta
Refactored local command execution to use IPC::Open3
Changed the is_installed() function for Debian to use the more accurate get_installed function. - Samuele Tognini
'-t' option should work with '-e' option.
rex -t 2 -H "hostA hostB" -e 'run "sleep 10"; say run "uptime"'
should run in parallel. - Tokuhiro MatsunoFixed loading of modules in $HOME/.rex/recipes
Don't calculate MD5 sums if there is no on_change hook for file() function - Franky Van Liedekerke
More specific error messages for authentication - Franky Van Liedekerke
Cloud/Amazon: support multiple security groups - RenatoCRON
$instance = cloud_instance create => { image_id => "ami-5187bb25", name => "test01", key => "thekey", zone => "eu-west-1a", type => "m1.large", security_groups => [ "alltcpfoo", "default" ], };
Documentation
- Fix pod about pubkey authentication - Joris
Rex/Gearman
- Fixed get_exit_codes use flag
Rex/Boxes
Creation order of VMs can now be defined in YAML file
type: VBox #vbox: # headless: 1 vms: - name: mem01 url: http://box.rexify.org/box/ubuntu-server-12.10-amd64.ova network: 1: type: bridged bridge: "en0: Ethernet" setup: setup_memcache - name: db01 url: http://box.rexify.org/box/ubuntu-server-12.10-amd64.ova network: 1: type: bridged bridge: "en0: Ethernet" setup: setup_db - name: www01 url: http://box.rexify.org/box/ubuntu-server-12.10-amd64.ova network: 1: type: bridged bridge: "en0: Ethernet" setup: setup_frontend