» Home » Docs » Release notes » Release notes for 0.51.2
Release notes for 0.51.2
These are the changes in 0.51 release.
Base
Load CMDB by default.
If you want to store data separated from your code (which is always a good idea) you can use the default Rex CMDB based on YAML. This feature was introduced in 0.40 and is now loaded by default with the following lookup path.
- cmdb/{operatingsystem}/{hostname}.yml
- cmdb/{operatingsystem}/default.yml
- cmdb/{environment}/{hostname}.yml
- cmdb/{environment}/default.yml
- cmdb/{hostname}.yml
- cmdb/default.yml
For example, if you have a CentOS server with the hostname web01, this means that if you request the key maxconn Rex will first try to find the key inside cmdb/CentOS/web01.yml and if it doesn't find the Rex will try the next file in the lookup path.
use Rex -feature => ['0.51']; task "setup", make { my $maxconn = get cmdb "maxconn"; };
If you're using Rex::Ext::ParamLookup it is even easier to work with a CMDB. You can write your code without using a CMDB and later, if you decide to use one, you can just add it without changing your code.
use Rex -feature => ['0.51']; use Rex::Ext::ParamLookup;
This will first check if there is a task parameter named **maxconn** and if not, it will try to look inside the CMDB. If it doesn't find the key anywhere it will just return the default provided by the second parameter (in this example *4096*).
Store server groups in an ini file
This feature is also available since a long time and now loaded by default. If there is a file named server.ini beside your Rexfile Rex will load it and create the server groups out of it. With this it is also possible to define special parameters for your hosts.
; my group file (server.ini) [frontends] fe01 fe02 fe03 fe04 fe05 # the backends [backends] be01 services=httpd,redis be02 services=httpd,redis ;be03 services=httpd,redis be04 services=httpd,redis [db] db[01..02] [redis] @backends redis01 user=toor password=foob4r sudo=true services=redis redis02 user=toor password=foob4r sudo=true services=redis
In your Rexfile you now have 4 groups (frontends, backend, db and redis). The servers redis01..02 uses a special authentication and be01..04, redis01..02 have a special parameter services which you can access within a task.
use Rex -feature => ['0.51'];
</code></pre>
Bugfixes
- #394 - export of is_symlink function
- #395 - is_file compatibility bug, doesn't detect symlinks anymore
- #393 - Added "." in the allowed char of lvm create - samuelet