Rex::G...::YAML(3pm)

✨ NAME ✨

okay so bestie, welcome to Rex::Group::Lookup::YAML πŸ’– β€” she reads hostnames and groups straight out of a YAML file. yes, literally. it's giving "User Contributed Perl Documentation" and honestly it ate πŸ‘‘


🌸 DESCRIPTION 🌸

so like. with this module you can define hostgroups out of an yaml file. that's the whole vibe. no cap πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole thing in four lines, she's easy like that:

use Rex::Group::Lookup::YAML;
groups_yaml "file.yml";

πŸ’… EXPORTED FUNCTIONS πŸ’…

groups_yaml($file, create_all_group => $boolean )

okay so this function is the main character πŸ‘‘ β€” you use it to read groups from yaml files. and there's an optional create_all_group option you can pass in. if you set it to true, the group all gets created too, with all the hosts in it. like, all of them. every single one. periodt πŸ’–

check it:

# in my_groups.yml
webserver:
 - fe01
 - fe02
 - f03
backends:
 - be01
 - be02
 - f03

# in Rexfile

groups_yaml('my_groups.yml');

# or
groups_yaml('my_groups.yml', create_all_group => TRUE);
bestie look at f03 πŸ‘€ she's in both groups, that's not a typo, that's just how the example is. also note the second call passes TRUE β€” capital letters, she's loud and proud ✨

and that's the whole page, slay 🌈

this lil doc lives in the User Contributed Perl Documentation section, it's perl v5.40.1 energy, and it was last touched 2025-10-03. mwah, take care of her πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from