Bug 1478769 - [RFE] Migrating a system from RHSM or SAM to Satellite 6 using the bootstrap script should not require the --force option.
Summary: [RFE] Migrating a system from RHSM or SAM to Satellite 6 using the bootstrap ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Bootstrap
Version: Unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Rich Jerrido
QA Contact: Ales Dujicek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-07 02:01 UTC by Rich Jerrido
Modified: 2019-09-25 20:32 UTC (History)
6 users (show)

Fixed In Version: katello-client-bootstrap-1.5.0-1.el7sat
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Rich Jerrido 2017-08-07 02:01:53 UTC
Description of problem:


When migrating a system from RHSM or SAM to Satellite 6 using bootstrap.py, the script will fail as it believes the system is already registered and the underlying subscription-manager command fails. Passing the --force option to bootstrap.py allows the registration to complete, however, this behavior is inconsistent. migrating from RHN/Sat doesn't require `--force`; migrating from RHSM/SAM does. 

Additionally, the --force option was orginally intended to allow a user to override the logic that bootstrap.py has to prevent a user from running the script against a system which is already properly registered. Having to use the --force switch for a common registration workflow is counter-intuitive and overloads the meaning of --force


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

katello-client-bootstrap-1.3.0


How reproducible:
100

Steps to Reproduce:
1. register a system to RHSM or SAM
2. run bootstrap.py without the --force switch. 
3.

Actual results:

the script fails with an error similar to the following

[NOTIFICATION], [2017-08-03 06:51:26], [Retrieving Client CA Certificate RPMs] 
[RUNNING], [2017-08-03 06:51:26], [rpm -Uvh http://satellite.example.com/pub/katello-ca-consumer-latest.noarch.rpm] 
Retrieving http://satellite.example.com/pub/katello-ca-consumer-latest.noarch.rpm
Preparing...                ##################################################
katello-ca-consumer-satellit##################################################
[SUCCESS], [2017-08-03 06:51:27], [rpm -Uvh http://satellite.example.com/pub/katello-ca-consumer-latest.noarch.rpm], completed successfully.

[NOTIFICATION], [2017-08-03 06:51:27], [Writing FQDN katello-fact] 
[NOTIFICATION], [2017-08-03 06:51:27], [Calling subscription-manager] 
[RUNNING], [2017-08-03 06:51:27], [/usr/sbin/subscription-manager register --org 'Example' --name 'sam-client.example.com' --activationkey 'ak_Reg_To_Library_EL6'  --serverurl=https://satellite.example.com:443/rhsm --baseurl=https://satellite.example.com/pulp/repos] 
[ERROR], [2017-08-03 06:51:28], EXITING: [/usr/sbin/subscription-manager register --org 'Example' --name 'sam-client.example.com' --activationkey 'ak_Reg_To_Library_EL6'  --serverurl=https://satellite.example.com:443/rhsm --baseurl=https://satellite.example.com/pulp/repos] failed to execute properly.
This system is already registered. Use --force to override



Expected results:
Register should complete without having to pass --force.

Comment 4 Rich Jerrido 2017-10-05 19:45:29 UTC
Moving to POST as https://github.com/Katello/katello-client-bootstrap/commit/72d0d23827e160fe9a84df878d3ec51f90fb89a8 has been merged.

Comment 6 Satellite Program 2018-02-21 16:54:17 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, 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-2018:0336


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