Skip to content

Commit

Permalink
Fixes #27255 - katello-change-hostname cleans puppet certs
Browse files Browse the repository at this point in the history
Also fixes an additional bug when changing the hostname on a proxy
caused by giving the installer an invalid parameter

(cherry picked from commit 58b3bd7)
  • Loading branch information
jturel authored and evgeni committed Aug 8, 2019
1 parent 1aabcd4 commit d86bc7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/katello/katello/hostname-change.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def check_for_certs_tar
def get_fpc_answers
register_in_foreman = false
certs_tar = @options[:certs_tar]
" --foreman-proxy-register-in-foreman #{register_in_foreman} --foreman-proxy-content-certs-tar #{certs_tar}"
" --foreman-proxy-register-in-foreman #{register_in_foreman} --certs-tar-file #{certs_tar}"
end

def precheck
Expand Down Expand Up @@ -167,6 +167,12 @@ def using_custom_certs?(scenario_answers)
scenario_answers["certs"]["server_cert_req"]
end

def delete_puppet_certs
puppet_ssldir = @scenario_answers['puppet']['ssldir']

run_cmd("rm -rf '#{puppet_ssldir}'")
end

def all_custom_cert_options_present?
@options[:custom_cert] && @options[:custom_key] && @options[:custom_cert_req]
end
Expand Down Expand Up @@ -335,6 +341,8 @@ def run
self.run_cmd("rm -rf #{@scenario_answers["foreman"]["client_ssl_key"]}")
end

delete_puppet_certs

STDOUT.puts "backed up #{public_dir} to #{public_backup_dir}"
STDOUT.puts "updating hostname in /etc/hosts"
self.run_cmd("sed -i -e 's/#{@old_hostname}/#{@new_hostname}/g' /etc/hosts")
Expand Down
2 changes: 2 additions & 0 deletions packages/katello/katello/katello.spec
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ Useful utilities for managing Katello services
%changelog
* Thu Aug 08 2019 Evgeni Golov - 3.12.2-1
- Release 3.12.2
- katello-change-hostname: clean puppet certs
- katello-change-hostname: s/foreman-proxy-content-certs-tar/certs-tar-file/

* Wed Jul 17 2019 Evgeni Golov - 3.12.1-1
- Release 3.12.1
Expand Down

0 comments on commit d86bc7c

Please sign in to comment.