Bug #24422
closedkatello-change-hostname should check current hostname to make sure that the hostname was not changed with a different tool
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.
Updated by John Mitsch over 6 years ago
- Description updated (diff)
- Category set to Backup & Restore
- Assignee set to John Mitsch
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman-packaging/pull/2808 added
Updated by John Mitsch over 6 years ago
- Target version set to Katello 3.9.0
- Triaged changed from No to Yes
Updated by Zach Huntington-Meath over 6 years ago
- Status changed from Ready For Testing to Closed