Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #24422 - k-c-h Check hostname is not current hostname #2808

Merged

Conversation

johnpmitsch
Copy link

For katello-change-hostname, often times users will use
hostnamectl to change the hostname before running k-c-h.
This causes the script to error out and leaves things in
a bad state. This commit adds a check that the hostname
specified is different than the current system's hostname.

For plugin updates, please indicate which repos this should be built into:

  • Nightly
  • 1.19
  • 1.18
  • 1.17

See Foreman's plugin maintainer documentation for more information.


Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need a release bump as well

@johnpmitsch
Copy link
Author

@ekohl updated, let me know if I bumped the release incorrectly with the new formatting

For katello-change-hostname, often times users will use
hostnamectl to change the hostname before running k-c-h.
This causes the script to error out and leaves things in
a bad state. This commit adds a check that the hostname
specified is different than the current system's hostname.
@johnpmitsch
Copy link
Author

To review:

  • Spin up a "newish" katello production installation (I would say 3.7+, nightly would be best).
  • clone foreman-packaging and checkout this PR
  • snapshots are highly encouraged at this point since you are dealing with katello-change-hostname, which heavily modifies a system. 😉
  • run ./packages/katello/katello/katello-change-hostname -u admin -p changeme $(hostname -f), this should fail with a warning since its trying to change the hostname to current hostname of the box.
  • run ./packages/katello/katello/katello-change-hostname -u admin -p changeme <NEW_HOSTNAME> using a new hostname in place of <NEW_HOSTNAME> and ensure the script completes successfully.
  • check anything else you deem important, such as changing the hostname first with hostnamectl and trying to use katello-change-hostname to change to that hostname (this is the behavior we are trying to prevent).

@johnpmitsch johnpmitsch merged commit 61b8978 into theforeman:rpm/develop Jul 31, 2018
@johnpmitsch johnpmitsch deleted the 24422-check-hostname branch July 31, 2018 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants