Rex::Group::Lookup::DBI - read hostnames and groups from a DBI source
With this module you can define hostgroups out of an DBI source.
use Rex::Group::Lookup::DBI; groups_dbi "dsn", "user", "password", "SQL request";
With this function you can read groups from DBI source.
CREATE TABLE IF NOT EXISTS `HOST` ( `ID` int(11) NOT NULL, `GROUP` varchar(255) DEFAULT NULL, `HOST` varchar(255) NOT NULL, PRIMARY KEY (`ID`) );
INSERT INTO `HOST` (`ID`, `GROUP`, `HOST`) VALUES (1, 'db', 'db01'), (2, 'db', 'db02'), (3, 'was', 'was01'), (4, 'was', 'was02');
To install Rex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rex
CPAN shell
perl -MCPAN -e shell install Rex
For more information on module installation, please visit the detailed CPAN module installation guide.