Bug 1315159

Summary: capsule-remove does not delete old certificates.
Product: Red Hat Satellite Reporter: Kamudini Gazdikova <kshirsal>
Component: CapsuleAssignee: Chris Roberts <chrobert>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.7CC: bbuckingham, bkearney, chrobert, inecas
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-02 22:01:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Kamudini Gazdikova 2016-03-07 06:00:41 UTC
Description of problem:
capsule-remove does not delete old certificates.

Version-Release number of selected component (if applicable):
- Red Hat Satellite v 6.1.7
- capsule-installer-2.3.24-1.el7sat.noarch 

Issue:

capsule-remove does not delete old certificate rpms. In katello-remove script, "/var/www/html/pub/katello-ca*.rpm" is removed, but it's missing in capsule-remove. That is why we have multiple versions of katello-ca-consumer. 

Confirmed by checking and comparing the files from "/usr/share/capsule-installer/bin/capsule-remove" && "/usr/share/katello/script/katello-remove" we can see that for 'CERT_FILES' section is missing to mention  for removal of "/var/www/html/pub/katello-ca*.rpm" whereas katello-remove has it scripted.

=============================
Capsule (capsule-remove) file
=============================



[root@dhcp9-147 ~]# cat /usr/share/capsule-installer/bin/capsule-remove
#!/bin/bash

echo ""
echo "WARNING: This script will erase many packages and config files."
echo "Important packages such as the following will be removed:"
echo ""
echo "  * httpd (apache)"
echo "  * mongodb"
echo "  * tomcat"
echo "  * puppet"
echo "  * ruby"
echo "  * rubygems"
echo "  * All Katello and Foreman Packages"
...

CERT_FILES=(
    /etc/pki/pulp/
    /etc/pki/katello
    /root/ssl-build
)

===============================
Satellite (katello-remove) file
===============================

[root@dhcp3-80 ~]# cat /usr/share/katello/script/katello-remove
#!/bin/bash

echo ""
echo "WARNING: This script will erase many packages and config files."
echo "Important packages such as the following will be removed:"
echo ""
echo "  * elasticsearch"
echo "  * httpd (apache)"
echo "  * mongodb"
echo "  * tomcat6"
echo "  * puppet"
echo "  * ruby"
echo "  * rubygems"
echo "  * All Katello and Foreman Packages"
......
...

CERT_FILES=(
    /etc/pki/pulp/
    /etc/pki/content/*
    /etc/pki/katello
    /root/ssl-build
    /etc/pki/tls/certs/katello-node.crt
    /etc/pki/tls/private/katello-node.key
    /etc/pki/tls/certs/pulp_consumers_ca.crt
    /etc/pki/tls/certs/pulp_ssl_cert.crt
    /var/www/html/pub/katello-ca*.rpm
)


Expected results:
capsule-remove should delete old certificates from /var/www/html/pub/.




Additional info:

Comment 4 Chris Roberts 2016-05-02 22:01:28 UTC
Closing this bug as BZ 1327442 is a changeup of configs etc and putting that all into 1 PR so merging this BZ with 1327442 for upstream sanity.

*** This bug has been marked as a duplicate of bug 1327442 ***