Rex::G...up::DBI(3pm)
π Rex::Group::Lookup::DBI π
okay bestie, so this is Rex::Group::Lookup::DBI β a lil Perl module that lives under the User Contributed Perl Documentation umbrella (3pm section, iykyk) π«Ά
β¨ NAME β¨
Rex::Group::Lookup::DBI β read hostnames and groups from a DBI source πΈ
π¦ DESCRIPTION π¦
With this module you can define hostgroups out of an DBI source. that's it, that's the vibe π
π SYNOPSIS π
use Rex::Group::Lookup::DBI;
groups_dbi "dsn", "user", "password", "SQL request";
π EXPORTED FUNCTIONS π
π groups_dbi($dsn, $user, $password, $sql)
With this function you can read groups from DBI source. Example, periodt:
groups_dbi( 'DBI:mysql:rex;host=db01',
user => 'username',
password => 'password',
sql => "SELECT * FROM HOST",
create_all_group => TRUE);
π Database sample for MySQL
no cap, here's the table shape you want:
CREATE TABLE IF NOT EXISTS `HOST` (
`ID` int(11) NOT NULL,
`GROUP` varchar(255) DEFAULT NULL,
`HOST` varchar(255) NOT NULL,
PRIMARY KEY (`ID`)
);
π§ Data sample for MySQL
and here's what the rows lowkey look like:
INSERT INTO `HOST` (`ID`, `GROUP`, `HOST`) VALUES
(1, 'db', 'db01'),
(2, 'db', 'db02'),
(3, 'was', 'was01'),
(4, 'was', 'was02');
hope that helped bestie, go slay your hostgroups πβ¨
this page rode in with perl v5.40.1, dated 2025-10-03, and it's serving Rex::G...up::DBI(3pm) energy β mwah, iconic, bye π
π¦ where this page comes from
- ubuntu resolute: rex 1.16.1-1 Β· Apache-2.0
- ubuntu stonking: rex 1.16.1-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms