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 1584776 - katello-change-hostname should check current hostname to make sure that the hostname was not changed with a different tool
Summary: katello-change-hostname should check current hostname to make sure that the h...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: satellite-change-hostname
Version: 6.2.14
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.4.0
Assignee: John Mitsch
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-31 15:50 UTC by Michal Dekan
Modified: 2021-09-09 14:20 UTC (History)
2 users (show)

Fixed In Version: katello-3.7.0-5
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:25:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 24422 0 Normal Closed katello-change-hostname should check current hostname to make sure that the hostname was not changed with a different to... 2020-10-14 14:45:53 UTC
Red Hat Bugzilla 1584743 0 low CLOSED katello-change-hostname does not update db.event_listeners 2021-09-09 14:20:39 UTC

Description Michal Dekan 2018-05-31 15:50:34 UTC
Description of problem:

This is to avoid bad tool usage as currently its possible to change the hostname with hostnamectl and then execute katello-change-hostname which leads to the error:

Error: smart_proxy not found
Couldn't find default Capsule id
Failed 'hammer -u admin -p changeme --output json capsule info --name old-hostname' with exit code 70


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

Satellite 6.2.14
Satellite 6.2.15

How reproducible:

Change satellite hostname with hostnamectl and then run katello-change-hostname

Steps to Reproduce:

1. hostnameclt set-hostname katello.example.com
2. katello-change-hostname katello.example.com -u admin -p XXX (will fail with above)

Changing to the old hostname with hostnamectl so katello-change-hostname can pass:

3. hostnamectl set-hostname test2.example.com
4. katello-change-hostname katello.example.com -u admin -p XXX (will pass)

Mongo will contain old hostname:
5. > db.event_listeners.find()
{ "_id" : ObjectId("5b0ff0b0226fa42c34df85b1"), "notifier_config" : { "url" : "https://test2.example.com/katello/api/v2/repositories/sync_complete?token=....


Actual results:

katello-change-hostname will run when hostname was already changed with hostnamectl which produces error.

Expected results:

Add check to find out if new hostname used with katello-change-hostname is matching with current hostname from hostnamectl. It should not match, if it does it should error out and not proceed further.

Comment 2 John Mitsch 2018-07-27 13:58:22 UTC
Created redmine issue https://projects.theforeman.org/issues/24422 from this bug

Comment 3 Satellite Program 2018-07-27 14:25:16 UTC
Upstream bug assigned to jomitsch

Comment 4 Satellite Program 2018-07-27 14:25:18 UTC
Upstream bug assigned to jomitsch

Comment 5 Peter Ondrejka 2018-09-05 13:05:48 UTC
Verified with satellite 6.4 snap 20 

satellite-change-hostname ... -u admin -p xxx
The hostname specified must be different from the current hostname. If you have changed the hostname with another utility, please change it back to the original hostname before running this tool.

Comment 6 Bryan Kearney 2018-10-16 19:25:16 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:2927


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