Description of problem: The "foreman_remote_execution:explain_proxy_selection" works great but It requires input for the PROVIDER env var or else the execution will abort. Someone who may not be aware of the possible providers to pass as value, It would be confusing to find out what to use. https://github.com/theforeman/foreman_remote_execution/pull/733 shows the use with SSH provider but Satellite 6.13 ( even 6.12 ) would only have either Script or Ansible as provider i guess. Version-Release number of selected component (if applicable): Satellite 6.13 How reproducible: Always Steps to Reproduce: 1. Install a Satellite 6.13 2. Register a client with the satellite 3. Actual results: # foreman-rake -D foreman_remote_execution:explain_proxy_selection rake foreman_remote_execution:explain_proxy_selection Explains which proxies can be used for remote execution against HOST using a specified PROVIDER. * HOST : A scoped search query to find hosts by * PROVIDER : The PROVIDER to scope by * FORMAT : Output format, one of verbose (or unset), json, pretty-json, csv * FOREMAN_USER : Run as if FOREMAN_USER triggered a job (runs as anonymous_admin if unset) * ORGANIZATION : Run in the context of ORGANIZATION (runs in any context if unset) * LOCATION : Run in the context of LOCATION (runs in any context if unset) # foreman-rake foreman_remote_execution:explain_proxy_selection HOST=host.example.com rake aborted! Environment variable PROVIDER has to be set /usr/share/gems/gems/foreman_remote_execution-8.2.0/lib/foreman_remote_execution/tasks/explain_proxy_selection.rake:18:in `block (2 levels) in <top (required)>' /usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>' Tasks: TOP => foreman_remote_execution:explain_proxy_selection (See full trace by running task with --trace) Expected results: # foreman-rake -D foreman_remote_execution:explain_proxy_selection ... * PROVIDER : The PROVIDER to scope by ( Script or Ansible ) ... ... # foreman-rake foreman_remote_execution:explain_proxy_selection HOST=host.example.com .. .. Environment variable PROVIDER has to be set ( possible values are Script and Ansible ) .. .. Of course, if there are some other types of provides present that I am missing, They can at least be a part of the Description of the rake. Additional info: No impact but simply an improvement request for better usability
I'm afraid that listing it in help (foreman-rake -D) is borderline impossible. The list is dynamic, depends on the loaded code and when printing the descriptions, rake does not load the application code. In other words, the description for the rake task has to be more or less static string, while we would need to have its contents generated dynamically. The second option (showing the possibilities when none is given by the user), is doable and actually an easy thing to do. Would that be enough?
Ah yes.. Even that works fine for me. The idea is to not leave it blank and give something for the user to work with.
Verified on Sat 6.14 snap 1. The list of providers is now returned in the described scenario: Environment variable PROVIDER has to be set to one of SSH, Script, Ansible. Note provider aliases SSH = Script.