Bug 2166404 - [RFE] Mention the list of possible providers in "explain_proxy_selection" rake task of Satellite 6.13
Summary: [RFE] Mention the list of possible providers in "explain_proxy_selection" rak...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Remote Execution
Version: 6.13.0
Hardware: All
OS: All
low
low
Target Milestone: 6.14.0
Assignee: Adam Ruzicka
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-01 17:49 UTC by Sayan Das
Modified: 2023-08-03 17:35 UTC (History)
2 users (show)

Fixed In Version: rubygem-foreman_remote_execution-10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36040 0 Normal Ready For Testing Mention available providers in rake foreman_remote_execution:explain_proxy_selection 2023-05-31 15:32:57 UTC
Github theforeman foreman_remote_execution pull 781 0 None open Fixes #36040 - Mention available providers in explain rake 2023-02-03 14:07:31 UTC
Red Hat Issue Tracker SAT-16397 0 None None None 2023-03-09 11:27:39 UTC

Description Sayan Das 2023-02-01 17:49:22 UTC
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

Comment 2 Adam Ruzicka 2023-02-03 13:46:26 UTC
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?

Comment 3 Sayan Das 2023-02-03 13:51:28 UTC
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.

Comment 6 Peter Ondrejka 2023-06-14 13:33:18 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.