How to mimic Satellite decision what Capsule is used for Remote Execution?
Environment
Red Hat Satellite 6.11 or newer
Issue
- Trying to run Remote Execution of some Host(s) registered via Capsules, unexpected Capsule is sometimes selected for connecting to the Host(s). Is there a way to understand the decision behind that?
Resolution
Create file /usr/share/gems/gems/foreman_remote_execution-*/lib/tasks/explain_proxy_selection.rake with a specified content:
curl https://raw.githubusercontent.com/adamruzicka/foreman_remote_execution/88b44de1fd1f00fe88f1402acf7a06077203ecbc/lib/foreman_remote_execution/tasks/explain_proxy_selection.rake > explain_proxy_selection.rake
mv explain_proxy_selection.rake /usr/share/gems/gems/foreman_remote_execution-*/lib/tasks/
Then run:
# foreman-rake foreman_remote_execution:explain_proxy_selection PROVIDER=SSH HOST=host.fqdn
PROVIDER=SSH is the way of connecting to the system, wither plain SSH or Ansible, and host.fqdn is the Host's FQDN.
Example output showing what Satellite/Capsule will be used by what strategy and why:
# foreman-rake foreman_remote_execution:explain_proxy_selection HOST=pmoravec-rhel7.gsslab.redhat.com PROVIDER=SSH
=> Host pmoravec-rhel7.gsslab.redhat.com
==> Strategy subnet
no proxies available using this strategy
==> Strategy fallback
strategy is disabled
==> Strategy global
1) pmoravec-caps612.gsslab.redhat.com - 0 tasks
2) pmoravec-sat612.gsslab.redhat.com - 1 tasks
==> Strategy registered_through
1) pmoravec-sat612.gsslab.redhat.com - 1 tasks
As of now, SSH job would use proxy pmoravec-sat612.gsslab.redhat.com, determined by strategy global.
#
For more KB articles/solutions related to Red Hat Satellite 6.x Remote Execution Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Remote Execution Issues
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.