Project

General

Profile

Bug #24422

katello-change-hostname should check current hostname to make sure that the hostname was not changed with a different tool

Added by John Mitsch over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Backup & Restore
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1584776

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):

latest dev

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.

History

#1 Updated by John Mitsch over 1 year ago

  • Assignee set to John Mitsch
  • Category set to Backup & Restore
  • Description updated (diff)

#2 Updated by The Foreman Bot over 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-packaging/pull/2808 added

#3 Updated by John Mitsch over 1 year ago

  • Triaged changed from No to Yes
  • Target version set to Katello 3.9.0

#4 Updated by Zach Huntington-Meath over 1 year ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF