» Home » Docs » Release notes » Release notes for 0.53.1
Release notes for 0.53.1
These are the changes in 0.53 release.
This release brings a few bugfixes and compatibility to the current Rex::JobControl Webfrontend.
A first version of the Rex::JobControl Webfrontend will also be released in the next days. But this will be a separate anouncement.
Base
Added a new resource function.
A resource is a perl function that represent a object on your server. An object is for example a virtual host configuration for apache, a database user or a more complex thing like a Tomcat instance. With the resource() function it is possible to create custom resources that will also appear in the reporting.
Resources have a special syntax and some keywords.
resource $resource_name, option1 => "value1", option2 => "value2", ensure => "present, absent, ...";
Currently there is only one keyword that every resource have to obey.
- ensure - Can be present (default if not set) or absent or any other string.
Every resource should also emit a changed signal if the resource did changes. With this signal the on_change hook gets triggered and the reporting knows that the resource changed something.
resource() parameters will also be visible in the templates without the need to register them.
Resources get registerd as perl functions in the namespace where they are created. You can see a complete example here.
package BaseSystem; use Rex::Resource::Common; resource "motd", sub { my ($params) = @_; my $name = resource_name; if ( $params->{ensure} eq "present" ) {
if ( !is_file($name) ) { file $name, content => $params->{content}; emit changed; } } elsif ( $params->{ensure} eq "absent" ) { if ( is_file($name) ) { rm $name; emit changed; } } };<span class="hljs-comment"># do some things.</span><span class="hljs-comment">
Now you can call this new resource with
BaseSystem::motd
use BaseSystem; task "setup", sub { BaseSystem::motd "/etc/motd", ensure => present, content => "Hello World.", on_change => sub {
}; };<span class="hljs-comment"># do something when changed event was triggered</span><span class="hljs-comment">
Added new feature flag register_cmdb_top_scope. This will register all the topscope variables in your CMDB to templates.
Bugfixes
- fixed a problem with CentOS 7 gathering the ip address with virtualbox guest tools.
- fixed on_change hook for file() resource when file was removed.
- #419 - fixed chkconfig bug for Mageia, Redhat and SuSE - chenryn.