Bug 1573374

Summary: [RFE] Save the capsule installer command in a file for capsule installation/upgrade automation
Product: Red Hat Satellite Reporter: sthirugn <sthirugn>
Component: InstallationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Devendra Singh <desingh>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2.14CC: sthirugn, zhunting
Target Milestone: UnspecifiedKeywords: FieldEngineering, FutureFeature, PrioBumpField, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-04 14:02:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sthirugn@redhat.com 2018-05-01 02:58:17 UTC
Description of problem:
Save the capsule installer command in a file for capsule installation/upgrade automation

Version-Release number of selected component (if applicable):
Satellite 6.2.14
Satellite 6.3.2

How reproducible:
Always

Steps to Reproduce:
1. On Satellite generate the capsule certs:
# capsule-certs-generate --capsule-fqdn "capsule.example.com" --certs-tar "~/capsule.example.com-certs.tar"
Installing             Done                                               [100%] [..................................................................................]
  Success!

  To finish the installation, follow these steps:
...
...
  3. Run the following commands on the capsule (possibly with the customized
     parameters, see satellite-installer --scenario capsule --help and
     documentation for more info on setting up additional services):

  satellite-installer --scenario capsule\
                    --capsule-parent-fqdn                         "satellite.example.com"\
                    --foreman-proxy-register-in-foreman           "true"\
                    --foreman-proxy-foreman-base-url              "https://satellite.example.com"\
                    --foreman-proxy-trusted-hosts                 "satellite.example.com"\
                    --foreman-proxy-trusted-hosts                 "capsule.example.com"\
                    --foreman-proxy-oauth-consumer-key            "RzBpmWYE3p2TkturvVrqKvb6ZV8MU6wV"\
                    --foreman-proxy-oauth-consumer-secret         "HPREkhiq7oZksyA5mYAcFDSrRy8gbdvL"\
                    --capsule-pulp-oauth-secret                   "uTFYSoS6Do3dvSmgTuzWTEvz9xXSfzmK"\
                    --capsule-certs-tar                           "/root/capsule.example.com-certs.tar"
  The full log is at /var/log/capsule-certs-generate.log

Actual results:
As shown above.  After running the above command, the user needs to copy the installer command provided by the above output and run in Capsule.  This is not user-friendly for automation.

Expected results:
The capsule installer command output provided by the capsule-certs-generate command should be saved as a script in the same path where the certs tar is created.

Additional info:
capsule-install is a new project for easy install/upgrade of capsules.  In this, we are currently extracting the installer command provided by capsule-certs-generate using regex as shown in:
https://github.com/sthirugn/capsule-maintain/blob/master/roles/create_certs/tasks/main.yml#L53
Although this works okay, this will not be a long-term viable solution and we need to save the installer command as proposed above.

Comment 3 Zach Huntington-Meath 2018-09-25 14:48:18 UTC
At the moment /var/log/foreman-installer/capsule.log has this information in it. Does accomplish the goal of this BZ?

Comment 4 sthirugn@redhat.com 2018-09-25 14:52:28 UTC
Nope, it is not very helpful for automated deployments.  If we can save that info from capsule.log in a file called $capsule.out or $capsule.sh in the current directory, this will help automate the capsules deployment easier and straightforward using Ansible or Puppet.

Comment 6 Bryan Kearney 2019-11-04 14:02:07 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.