» Home » Docs » Release notes » Release notes for 0.26
Release notes for 0.26
Rex
License was changed to Apache 2.0 License. See LICENSE file.
Added sudo compatibility. Now it is possible to use rex within a sudo environment.
user "unprivuser"; sudo_password "f00b4r"; sudo -on; # turn sudo globally on task prepare => sub { install "apache2"; file "/etc/ntp.conf", source => "files/etc/ntp.conf", owner => "root", mode => 640; };
Or, if you don't want to turn sudo globally on.
task prepare => sub { file "/tmp/foo.txt", content => "this file was written without sudo privileges\n"; # everything in this section will be executed with sudo privileges sudo sub { install "apache2"; file "/tmp/foo2.txt", content => "this file was written with sudo privileges\n"; }; };
Added a new function include to include Rex recipes without registering the tasks.
include qw/Webserver::Apache Database::MySQL/;
Added a sed-like function.
task foo => sub { sed qr{search}, "replace", "/path/to/file"; };
Package installation now possible with install $pkg.
task prepare => sub { install "foo"; # old way install package => "foo"; };
Added chdir parameter to extract function.
task prepare => sub { extract "/tmp/myfile.tar.gz", chdir => "/etc"; };
sync exclude option now accepts a string or an array of strings. Thanks to Hiroaki Nakamura.
Added support for custom init commands.
task graceful_apache => sub { service httpd => "graceful"; };