forked from RexOps/Rex
-
Notifications
You must be signed in to change notification settings - Fork 0
New09
krimdomu edited this page Jul 11, 2011
·
4 revisions
These functions are new in (R)?ex Version 0.9. Download (R)?ex here: http://rexify.org/get/
-
Added Ubuntu support.
-
Register tasks as function if possible
-
New function get_operating_system to get the Operating System.
-
Transactions
Added Transaction and the possibility to rollback on transaction failures.
use Rex::Transaction; task "do_something", sub { on_rollback { unlink "/tmp/test"; }; touch "/tmp/test"; die; }; task "make", sub { transaction { do_task "do_something"; }; };
-
Inventory
Now it's possible to make an inventory of your hardware.
use Data::Dumper; use Rex::Commands::Inventory; task "inventory", "server1", "server2", sub { my $inventory = inventor(); print Dumper($inventory); };
-
New function file
Use this function to upload a file to your servers.
task "upload", "server1", sub { file "$path/vhost.conf", content => template("../../templates/vhost.conf.tpl"), # on change of the file, do something on_change => sub { say "file was modified"; }; };