Skip to content

Instantly share code, notes, and snippets.

@spicyjack
Created August 23, 2014 13:11
Show Gist options
  • Save spicyjack/e1e183e30160de82b298 to your computer and use it in GitHub Desktop.
Save spicyjack/e1e183e30160de82b298 to your computer and use it in GitHub Desktop.
use Rex -feature => [qw/use_server_auth/];
use Rex::Commands::Gather;
use Rex::Group::Lookup::INI;
groups_file "../servers.ini";
#group servers => qw/foo bar/;
desc "Get info about the servers in 'servers.ini'";
### TASK: uptime
task 'uptime', group => 'servers', sub {
my $output = run q(uptime);
say $output;
};
### TASK: uptime
task 'system_info', group => 'servers', sub {
say dump_system_information();
};
@ehuelsmann
Copy link

cat t
use strict;
use warnings;
use Rex -feature => [qw/use_server_auth/];
use Rex::Commands::Gather;
use Rex::Group::Lookup::INI;

groups_file "servers.ini";

group servers => qw/foo bar/;

desc "Get info about the servers in 'servers.ini'";

TASK: uptime

task 'uptime', group => 'servers', sub {
my $output = run q(uptime);
say $output;
};

TASK: uptime

task 'system_info', group => 'servers', sub {
say dump_system_information();
};

1;

@ehuelsmann
Copy link

$ perl -v

This is perl 5, version 14, subversion 2 (v5.14.2) built for i486-linux-gnu-thread-multi-64int

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment