1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
#
# (c) Jan Gehring <jan.gehring@gmail.com>
#
=head1 NAME
Rex::Commands::Inventory - Get an inventory of your systems
=head1 DESCRIPTION
With this module you can get an inventory of your system.
All these functions will not be reported. These functions don't modify anything.
=head1 SYNOPSIS
use Data::Dumper;
task "inventory", "remoteserver", sub {
my $inventory = inventory();
print Dumper($inventory);
};
=head1 EXPORTED FUNCTIONS
=cut
package Rex::Commands::Inventory;
use v5.12.5;
use warnings;
our $VERSION = '1.14.1'; # VERSION
use Rex::Inventory;
require Rex::Exporter;
use vars qw(@EXPORT);
use base qw(Rex::Exporter);
@EXPORT = qw(inventor inventory);
=head2 inventory
This function returns a hashRef of all gathered hardware. Use the Data::Dumper module to see its structure.
task "get_inventory", sub {
my $inventory = inventory();
print Dumper($inventory);
};
=cut
sub inventory {
my $inv = Rex::Inventory->new;
return $inv->get;
}
sub inventor {
return inventory();
}
1;
|