Description of problem: satelite-change-hostname leaves old entry of Satellite server in "All Hosts" page after the renaming gets completed. Version-Release number of selected component (if applicable): Red Hat Satellite 6.10 How reproducible: Always Steps to Reproduce: 1. Install Satellite 6.10 with name satellite.example.com 2. Use --> satellite-change-hostname change.example.com -u admin -p XXXX 3. Once completed look at "Hosts --> All Hosts" page Actual results: It shows both old and new entry i.e. satellite.example.com as well as change.example.com Expected results: * Old entry should get removed automatically. * If above is not possible, then we need to include an additional step in documentation to do so i.e. removal of old entry manually. Additional info: * This is not applicable if we are renaming a capsule server. I don't see this behavior there.
Is this a regression from Satellite 6.9?
I cannot confirm that but I will say that part of the code was probably missing always. Let me check that real quick and get back to you on that.
Hello Brad, I could not check practically but It seems, for Satelite 6.9 also the same issue should persist. I can see the only change in code is following and based on that I would say, satellite-change-hostname always had this missing but it was never reported. --- hostname-change.rb_fromsat69 2021-02-11 07:12:29.000000000 -0500 +++ hostname-change.rb_fromsat610 2021-08-19 10:51:05.825675017 -0400 @@ -212,6 +212,8 @@ end def delete_puppet_certs + return unless @scenario_answers['puppet'].is_a?(Hash) + puppet_ssldir = @scenario_answers['puppet']['ssldir'] run_cmd("rm -rf '#{puppet_ssldir}'") @@ -495,9 +497,14 @@ STDOUT.puts "updating hostname in foreman installer scenarios" self.run_cmd("sed -i -e 's/#{@old_hostname}/#{@new_hostname}/Ig' #{scenarios_path}/*.yaml") - STDOUT.puts "updating hostname in hammer configuration" - self.run_cmd("sed -i.bak -e 's/#{@old_hostname}/#{@new_hostname}/Ig' #{hammer_root_config_path}/*.yml") - self.run_cmd("sed -i.bak -e 's/#{@old_hostname}/#{@new_hostname}/Ig' #{hammer_config_path}/*.yml") + if File.exist?(hammer_root_config_path) or File.exist?(hammer_config_path) + STDOUT.puts "updating hostname in hammer configuration" + [hammer_root_config_path, hammer_config_path].each do |config_dir| + Dir[File.join(config_dir, "*.yml")].each do |config_file| + self.run_cmd("sed -i.bak -e 's/#{@old_hostname}/#{@new_hostname}/Ig' #{config_file}") + end + end + end if File.exist?(last_scenario_yaml) STDOUT.puts 'backing up last_scenario.yaml'
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team. Thank you.