Rex::He...amLookup(3)

πŸ“¦ version 1.14.3, in nixos 26.05, nixpkgs unstable

πŸ’… Rex::Helper::Rexfile::ParamLookup β€” the manual page, but make it make sense

okay so bestie, you're reading the <pink>User Contributed Perl Documentation</pink> page for Rex::He...amLookup(3) (yes the title is squished, that's just how the man page grind works, we move) ✨


🌸 NAME 🌸

Rex::Helper::Rexfile::ParamLookup β€” it's literally a command for managing task parameters πŸŽ€

Like, that's the whole gig: it handles task parameters. And also β€” main character bonus feature β€” it registers those parameters as template values, so your templates can vibe with them too. πŸ’–

Oh and it doesn't stop at task params either: this module also peeks inside a CMDB (if one is present) looking for a valid key. iykyk πŸ”₯


πŸ¦‹ SYNOPSIS πŸ¦‹

task "setup", sub {
  my $var = param_lookup "param_name", "default_value";
};

that's it. that's the look. no cap πŸ’…


✨ LOOKUP ✨

okay so here's the order of operations, bestie, listen up πŸ‘‘

First, param_lookup checks the task parameters for a valid parameter. Simple, iconic.

If nothing turns up there, and if a CMDB is being used, it'll go looking inside the cmdb. πŸ•΅οΈβ€β™€οΈ

and here's the fun part β€” the namespacing behaviour, ngl this is lowkey the whole point:

If your module is named "Rex::NTP", then it will first look to see whether the key "Rex::NTP::param_name" exists. If that one doesn't exist, then it checks for the key "param_name". 🫢

so the module-scoped key gets first dibs, and the plain un-namespaced key is the fallback. that's the vibe check. ⭐

🧚 sign-off 🧚

this page is from perl v5.42.3, dated 2023-08-05 β€” go off, queen πŸŒˆπŸ‘‘ thanks for reading, now go pass your params πŸ’œ

πŸ“¦ where this page comes from