Skip to content

Hide a task #1614

Closed Answered by ferki
LeMerP asked this question in Q&A
Feb 11, 2024 · 1 comment
Discussion options

You must be logged in to vote

Hi @LeMerP,

there's an internal-facing dont_register option you may attach to task definitions, like this:

Rex/lib/Rex/Commands/Box.pm

Lines 418 to 420 in 0f87255

task 'get_sys_info', sub {
return { get_system_information() };
}, { dont_register => 1, exit_on_connect_fail => 0 };

See also:

  • Basic anatomy of Rex task definitions for a quick summary on the general structure of task definitions
  • include command to "Include a module without registering its tasks" (instead of loading modules with Perl's own use and require)

Happy hacking!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LeMerP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants