» Home » Docs » Release notes » Release notes for 0.46
Release notes for 0.46
These are the changes in 0.46 release.
We want to thank all the people for contributing code and to fill bug reports. This helps making Rex better and better :)
Incompatible Changes
We're sorry, but this release comes with some incompatible changes. The most changes won't effect the majority of users, but we needed to change those things to fix some nasty things and to be more flexible in the future.
- Reporting: The report format changed. The output and the internal API of the reporting interface changed. With this change we are more flexible for future improvements.
- User module: We changed the creation of home directories to follow the policy of the target system.
- Core: Caching is now active by default. This might break things if you're using chroot() inside a task, to change to another system. (For example to chroot from a debian system into a redhat system.)
Rex::Test
With Rex::Test it is possible to test your Rexfile on a local VM before executing the code on your servers. Rex::Test uses Rex::Box to create the VM, but currently it only supports VirtualBox VMs.
To create a test just create a new file inside a t directory: t/base.t.
use Rex::Test::Base;
use Data::Dumper;
use Rex -base;
test {
my $t = shift;
$t->name("ubuntu test");
$t->base_vm("http://box.rexify.org/box/ubuntu-server-12.10-amd64.ova");
$t->vm_auth( user => "root", password => "box" );
$t->run_task("setup");
$t->has_package("vim");
$t->has_package("ntp");
$t->has_package("unzip");
$t->has_file("/etc/ntp.conf");
$t->has_service_running("ntp");
$t->has_content( "/etc/passwd", qr{root:x:0:}ms );
run "ls -l";
$t->ok( $? == 0, "ls -l returns success." );
$t->finish;
};
1;
Rex::Box
Create clean development environments for your projects. Test your software in a production like environment.
With Rex/Boxes you can easily create your test environment with VirtualBox. You can use prebuild VM Images or roll your own. Read the quickstart guide to create your own environment in minutes.
This release brings support for KVM boxes. The KVM Rex::Box provider also allows the creation of Boxes on remote systems.
# Rexfile set box => "KVM";
box {
<span class="hljs-keyword">my</span> (<span class="hljs-type">$box</span>) = <span class="hljs-type">@_</span>;
<span class="hljs-type">$box</span>-><span class="hljs-type">name</span>( <span class="hljs-type">$param</span>->{name} );
<span class="hljs-comment"># where to download the base image</span><span class="hljs-comment">
$box->url( $param->{url} );
<span class="hljs-comment"># default is nat</span><span class="hljs-comment">
$box->network( 1 => { type => "nat", }, 2 => { type => "bridged", bridge => "br1", } );
<span class="hljs-comment"># define the authentication to the box</span><span class="hljs-comment">
# if you're downloading one from box.rexify.org this is the default. $box->auth( user => "root", password => "box", );
<span class="hljs-comment"># if you want to provision the machine,</span><span class="hljs-comment">
# you can define the tasks to do that $box->setup(qw/install_webserver/); };
};
Cloud
Changes in the Cloud API
Support for RackSpace via modules.
Authentication and endpoint.
cloud_service "RackSpace"; cloud_auth "user", "key"; cloud_region "IAD";
Creating volumes and vms.
cloud_service "RackSpace"; my $vol_id = cloud_volume create => { size => 1, };
cloud_volume attach => $vol_id, to => $instance->{id};
- Terminating an instance and removing the volume.
<pre><code class="hljs">cloud_service "<span class="hljs-string">RackSpace</span>";
cloud_instance terminate => $instance->{id}; cloud_volume delete => $vol_id;
- fixed a case where amazon returns instance item in an array - Kasim Tuman
- fixed multiple tags - David Golovan
Reporting
- Refactored report generation. This change break backward compatibility because the report format changed.
Core
Caching is now enabled by default. This might break backward compatibility if you're using chroot() inside a task to chroot to another OS.
Allow passing template content to template command - #345 - reneeb
file "/etc/file.cnf", content => template( \'<%= $name %> is cool!', name => 'Rex' );
Added 'no_cache' feature. If you need to disable the cache, use this.
# Rexfile use Rex -feature => ['no_cache'];
Added a special load path for perl libraries, so that we don't mix up perl and rex modules. (lib/perl)
Refactored handling of home directory creation. This might break compat. because we are following the system default now. (added create_home option) - #270 - FErki
CMDB path can now have variables / can be extended.
# Rexfile use Rex::CMDB; set cmdb => { type => "YAML", path => [ "cmdb/{operatingsystem}/{hostname}.yml", "cmdb/{operatingsystem}/default.yml", "cmdb/{environment}/{hostname}.yml", "cmdb/{environment}/default.yml", "cmdb/{hostname}.yml", "cmdb/default.yml", ], };
Connect failure reports "Error running task/batch: Wrong username/password or wrong key" - #359 - eduardoj
Extended rexify command to work with git.
Added description to environments - #274
# Rexfile desc "The live environment"; environment live => sub { };
Added
groups_dbi()
function to generate server groups from sql - #346 - Jean-Marie RENOUARDAdded
groups_yaml()
function to generate server groups from yaml file - Jean-Marie RENOUARDAdd support for df on a given mount point - Simon Bertrang
Added authentication to download() function. - #340
download "http://secured.location.tld/foo.tgz", "foo.tgz", user => "httpuser", password => "password";
Refactored tmp dir generation - FErki