» Home » Docs » Release notes » Release notes for 0.33
Release notes for 0.33
General
Speed improvement
The -c (cache) CLI option speeds up execution very much.
Profiler class
This is mostly for developers. There is now a profiler class to profile execution of things.
If you want to generate a profiling output you can do this with:
rex -dd $yourtask
Mounting (thanks to Laird Liu)
It is now possible to write mount entries to /etc/fstab with the persistent option.
mount "/dev/sda5", "/mnt/sda5", persistent => TRUE;
Partitioning
It is now possible to mount the new created partition.
partition "/", fstype => "ext3", size => 15000, ondisk => "sda", type => "primary", mount => TRUE;
And if you want to write fstab entries directly.
partition "/", fstype => "ext3", size => 15000, ondisk => "sda", type => "primary", mount_persistent => TRUE;
New keyword make.
This is just a cosmetic one. It is now possible to write tasks this way:
# old task prepare => sub {
# do something };
<span class="hljs-comment"># do something</span><span class="hljs-comment">
};
# old task "prepare", group => "foo", sub { # do something };
# new task "prepare", group => "foo", make { # do something };
- Usability improvements, thanks to Anders Ossowicki
User Management
New option no_create_home
There is a new option no_create_home. If this option is set the home directory of the user will not be created.
If the ssh_key option is set it will only create the .ssh directory if the home directory exists.
create_user "foo", home => "/data/homes/foo", no_create_home => TRUE;
Fixed expire bug for create_user
Templates
Template class now exchangeable (thanks to Laird Liu)
If you want to use another Template class (for example Template::Toolkit) you can use it now.
# Rexfile use strict; use warnings;
set template_function => sub { my ( $content, $vars ) = @_; my $t = Template->new; my $out; $t->process( \$content, $vars, \$out ); return $out; };
task foo => sub { file "/etc/foo/service.conf", content => template( "service.conf.tpl", name => "foo", port => 1903 ); };
Modules
It is now easier to write independent modules. There is no break in compatibility. Both ways will work. But we suggest to rewrite/move your files.
Old-way module structure:
lib/Apache.pm
lib/templates/apache-template
lib/Apache/SubModule.pm
New module structure:
lib/Apache/Module.pm (this is the old lib/Apache.pm)
lib/Apache/templates/apache-template
lib/Apache/SubModule.pm
Converting an old module
It is easy to convert an old module. For the example from above, you just have to move the file "lib/Apache.pm" to "lib/Apache/Module.pm" (no code changes needed). And move the templates to "lib/Apache/templates".