» Home » Docs » Release notes » Release notes for 0.45
Release notes for 0.45
These are the changes in 0.45 release.
We want to thank all the people for contributing code and to fill bug reports. This helps making Rex better and better :)
Cloud
Changes in the Cloud API
OpenStack Support - Ferenc Erki
Authentication and endpoint.
cloud_service "OpenStack"; cloud_auth tenant_name => "tenant", username => "user", password => "password"; cloud_region "http://openstack.domain.tld:5000/v2.0";
Creating volumes and vms.
my $vol_id = cloud_volume create => { size => 1, zone => "nova", };
- Terminating an instance and removing the volume.
<pre><code class="hljs">cloud_instance terminate => <span class="hljs-type">$instance</span>->{id};
cloud_volume delete => $vol_id;
- added cloud_image_list() function
- added cloud_network() function to manage cloud networks if the provider supports it
Common
Changes in the core. These include new resources and new options for existing one.
new options for the file() resource
no_overwrite option for file() resource.
If this option is set, the file will never be overwritten.
file "/var/named/$zone->{name}.zone", content => template( '@zone-file.tpl', conf => $conf, %{$zone} ), owner => "named", group => "named", no_overwrite => TRUE;
ensure directory option for file().
If the ensure option is set to directory the file() resource will create a directory instead of a file
file "/var/named", ensure => "directory", owner => "named", group => "named";
allow array for file() resource.
This allow operations on multiple files without duplicating the code.
file [ "/etc/rex/io/inventory/bootdevice", "/etc/rex/io/inventory/bridge", "/etc/rex/io/inventory/sysinfo", "/etc/rex/io/inventory/os" ], owner => "root", group => "root", mode => 755;
New options for run() resource.
run() resource can now have a name.
This is needed for notifications, if a command should only be executed if notified.
run "kill-process-httpd", command => "killall -KILL httpd", only_notified => TRUE;
- *creates* option for run() resource.
This tell Rex that this command creates a special file. If this file is found, the command won't get executed anymore.
<pre><code class="hljs">run "<span class="hljs-string">download-ipxe</span>",
command => "wget -O /var/lib/tftpboot/undionly.ipxe http://boot.ipxe.org/undionly.kpxe", creates => "/var/lib/tftpboot/undionly.ipxe";
- *only\_if* and *unless* option for run() resource.
This will execute the command only if the command given will execute successfully (or terminate unsuccessfull).
<pre><code class="hljs">run "<span class="hljs-string">add-service-os</span>",
command => "mysql -uroot < /tmp/data.sql", unless => "mysql -uroot dbschema -e 'SELECT id FROM os_template WHERE id=2' | grep -q 2";
- support for customized environments. - \#316 - andrejzverev
It is now possible to add custom environment variables to the run() resource.
<pre><code class="hljs">run "<span class="hljs-string">my_command</span>",
env => { env_var_1 => "the value for 1", env_var_2 => "the value for 2", };
Added notifications for run and service.
services will notified at the end of the task.
service "httpd", ensure => "running";
pkg resource (replacement for install function).
pkg "vim", ensure => "present"; pkg "httpd", ensure => "2.4.6"; pkg "vim-tiny", ensure => "absent"; pkg [ "tftp-server", "wget" ], ensure => "latest";
Added account() resource (as replacement for create_user).
account "krimdomu", ensure => "present", uid => 509, home => '/root', comment => 'User Account', expire => '2011-05-30', groups => [ 'root', '...' ], password => 'blahblah', system => 1, no_create_home => TRUE, ssh_key => "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQChUw...";
Support -g to supply group name - #330 - fanyeren
can_run() now returns the first command found as string - #193
read cpu information out of /proc/cpuinfo if dmidecode is not available - #306
Bugfixes
Known bugs that has been fixed.
Check if iptables rule already exists.
Fixed SCM::Git to work with sudo.
Update _parse_ip subroutine. be possible to parse ppp0. #328 - Tomohiro Hosaka.
Handles the case where rsync is missing, and that makes Rex wait forever - #331 - Joris DE POOTER.
Fixed $Rex::Logger::format does not apply. - #335.
Fixed download() command on windows.
Fixed debian system_update - #339 - Niklas Larsson.