Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1343546

Summary: Bootstrap script should run commands with --force
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: BootstrapAssignee: Rich Jerrido <rjerrido>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Pramuk <lpramuk>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: egolov
Target Milestone: Unspecified   
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: 2016-06-07 15:27:54 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 Lukas Pramuk 2016-06-07 12:43:42 UTC
Description of problem:
Bootstrap script should run commands with --force to successfully handle situation when you re-run script or you have already registerred host

Version-Release number of selected component (if applicable):
@Sat6.2.0-Snap14
katello-client-bootstrap-1.1.0-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1a. Have a host regged to CDN
2a. Run ./bootstrap.py and watch it fail with "subscription-manager register..."
[ERROR], [2016-06-07 06:28:08], EXITING: [/usr/sbin/subscription-manager register --org 'Default_Organization' --name '<CLIENT_FQDN>' --activationkey 'My Activation Key'  --serverurl=https://<SAT_FQDN>:443/rhsm --baseurl=https://<SAT_FQDN>/pulp/repos] failed to execute properly.
This system is already registered. Use --force to override

1b. Have a host that ha bootstrap ca certs installed
2b. Run ./bootstrap.py and watch it fail with "rpm -Uvh <bootstrap-ca-certs>..."
[ERROR], [2016-06-06 08:49:13], EXITING: [rpm -Uvh http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm] failed to execute properly.
Retrieving http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm
Preparing...                ##################################################
	package katello-ca-consumer-<SAT_FQDN>-1.0-1.noarch is already installed

Actual results:
failure 

Expected results:
success

Additional info:
rpm -Uvh --force http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm would handle situation when rpm is already installed, RC=0

Comment 2 Evgeni Golov 2016-06-07 14:55:32 UTC
Why aren't you passing --force to the bootstrap script?
That should clean up all existing subs and rpms.

Comment 3 Lukas Pramuk 2016-06-07 15:27:19 UTC
Ooops, I had to miss it.