Rex::G...up::INI(3pm)

πŸ’– Rex::Group::Lookup::INI πŸ’–

okay so bestie, this is a Perl module β€” it lives in the Rex::G...up::INI(3pm) zone (that 3pm is just the manual section, it's giving library-docs energy, not command-line) β€” and fr fr its whole thing is: it reads host names and host groups straight out of an INI style file. no cap.


✨ DESCRIPTION ✨

With this module you can define host groups in an INI style file. that's it, that's the vibe. simple, iconic, slay. πŸŽ€


🌸 SYNOPSIS 🌸

like, here's the whole moveset:

use Rex::Group::Lookup::INI;
groups_file 'file.ini';

that's literally it. two lines and you're eating. πŸ“


πŸ¦‹ EXPORTED FUNCTIONS πŸ¦‹

πŸ’… groups_file($file)

With this function you can read groups from INI style files. pass it the file, it hands you the groups. main character energy.

File example:

# servers.ini
[webservers]
fe01
fe02

[backends]
be[01..03]

It supports the same expressions as the group command. (iykyk πŸ’œ)

Since 0.42, it also supports custom host properties if the use_server_auth feature flag is enabled:

# servers.ini
[webservers]
server01 user=root password=foob4r sudo=true services=apache,memcache

# Rexfile
use Rex -feature => ['use_server_auth'];

task 'list_services', group => 'webservers', sub {
  say connection->server->option('services');
}
lowkey obsessed with the fact that you can just staple user=, password=, sudo= and services= onto a host line now. but clock the fine print: that only happens when use_server_auth is enabled. no flag, no properties, periodt. ⭐

okay that's the whole page, you're welcome 🫢 this lil doc was served up by perl v5.40.1, dated 2025-10-03, and the manual name up top is your girl Rex::G...up::INI(3pm). go forth and group your hosts, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from