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
  • Loading branch information
jturel authored and ekohl committed Jul 23, 2019
1 parent 04f5390 commit 58b3bd7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 9 additions & 1 deletion packages/katello/katello/hostname-change.rb
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
6 changes: 5 additions & 1 deletion packages/katello/katello/katello.spec
Expand Up @@ -4,7 +4,7 @@
%global homedir %{_datarootdir}/%{name}
%global confdir common
%global prerelease .master
%global release 3
%global release 4

Name: katello
Version: 3.13.0
Expand Down Expand Up @@ -194,6 +194,10 @@ Useful utilities for managing Katello services
%{_sysconfdir}/bash_completion.d/katello-service

%changelog
* Sun Jul 21 2019 Jonathon Turel <jturel@gmail.com> 3.13.0-0.4.master
- katello-change-hostname: clean puppet certs
- katello-change-hostname: s/foreman-proxy-content-certs-tar/certs-tar-file/

* Fri Jun 07 2019 Lukas Zapletal <lzap+rpm@redhat.com> 3.13.0-0.3.master
- BZ#1710625 - updated qpidd debug paths

Expand Down

0 comments on commit 58b3bd7

Please sign in to comment.