Feature #20799
closedkatello-change-hostname needs better requirements checking
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.$
Updated by John Mitsch over 7 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
Updated by The Foreman Bot over 7 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello-packaging/pull/516 added
Updated by John Mitsch over 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello-packaging|d3fe631e52f0d6837243c10cfcf2d1ec0a8aed77.
Updated by John Mitsch over 7 years ago
- Category set to Backup & Restore
- Translation missing: en.field_release set to 295