Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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: CLOSED ERRATA
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-11-08 14:18 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: 2023-11-08 14:18:18 UTC
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
Red Hat Product Errata RHSA-2023:6818 0 None None None 2023-11-08 14:18:45 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.

Comment 9 errata-xmlrpc 2023-11-08 14:18:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.14 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6818


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