Project

General

Profile

Feature #20799

katello-change-hostname needs better requirements checking

Added by John Mitsch almost 5 years ago. Updated almost 4 years ago.

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

Description

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

Description of problem:

katello-change-hostname should check requirements before performing any changes on server. It should work in an "all or nothing" way, so if it does not have everything needed to complete successfully, it should do nothing.

Currently, the checking is done while making changes. Consider an example with invalid hostname:

~]# katello-change-hostname 9899.$ -u admin -p changeme
This will modify your system. You will need to re-register any Foreman Proxies and Foreman clients after script completion. Foreman Proxies will have to be reinstalled. If you are using custom certificates, you will have to run the foreman-installer again with custom certificate options after this script completes. Have you taken the necessary precautions (backups, snapshots, etc...) and want to proceed with changing your hostname? [y/n]:Updating default Foreman Proxy

Updating installation media paths
updating hostname in /etc/hostname
setting hostname
checking if hostname was changed
the new hostname was not changed successfully, exiting script

This seems correct, but when checking the hostname, we can see it was actually changed:

~]# hostname
9899

~]# hostnamectl
Static hostname: 9899
Pretty hostname: 9899.$

Associated revisions

Revision d3fe631e (diff)
Added by John Mitsch almost 5 years ago

Fixes #20799 - add valid fqdn check for kchange-hostname

History

#1 Updated by John Mitsch almost 5 years ago

  • Subject changed from katello-change-hostname needs better requirements checking to katello-change-hostname needs better requirements checking
  • Target version set to 213

#2 Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello-packaging/pull/516 added

#3 Updated by John Mitsch almost 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by John Mitsch almost 5 years ago

  • Category set to Backup & Restore
  • Legacy Backlogs Release (now unused) set to 295

Also available in: Atom PDF