Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1327442

Summary: Satellite 6.2 Beta: capsule-remove doesn't remove foreman-installer configs, which causes failure of next capsule install
Product: Red Hat Satellite Reporter: Pradeep Kumar Surisetty <psuriset>
Component: Foreman ProxyAssignee: Chris Roberts <chrobert>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, chrobert, cwelton, dlezzoum, dnagarat, kbidarka, kshirsal, mmccune, sthirugn, xdmoon
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/14906
Whiteboard:
Fixed In Version: katello-installer-base-3.0.0.22-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:12:24 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:
Embargoed:
Bug Depends On: 1350897    
Bug Blocks: 1115190    

Description Pradeep Kumar Surisetty 2016-04-15 07:38:39 UTC
Description of problem:

1) install capsule and register with satellite
2) Remove it with capsule-remove
3) Try capsule-install again on same node

It fails as it hasn't deleted old /etc/foreman-installer configs

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1) install capsule and register with satellite
2) Remove it with capsule-remove
3) Try capsule-install again on same node

Actual results:
capsule install failure

Expected results:

successful capsule install 

Additional info:

Comment 2 Chris Roberts 2016-05-02 22:01:21 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/.

Comment 3 Chris Roberts 2016-05-02 22:01:28 UTC
*** Bug 1315159 has been marked as a duplicate of this bug. ***

Comment 4 Bryan Kearney 2016-05-05 18:19:36 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/14906 has been closed

Comment 5 Chris Roberts 2016-06-03 03:13:15 UTC
*** Bug 1336270 has been marked as a duplicate of this bug. ***

Comment 6 Sanket Jagtap 2016-06-08 12:08:33 UTC
Build :satellite 6.2 Snap 14.1


cat /usr/share/foreman-installer-katello/bin/capsule-remove
So,the capsule-remove script has 

CERT_FILES=(
    /etc/pki/pulp/
    /etc/pki/katello
    /root/ssl-build
    /var/www/html/pub/katello-ca*.rpm
)

The output of command:
....
....
Complete!
Cleaning up configuration files
Cleaning up log files
Cleaning up Certs

Now , on trying to install Capsule again

 
satellite-installer --scenario capsule --parent-fqdn "sjagtap-sat6.satellite.lab.eng.rdu2.redhat.com" --register-in-foreman "true" --foreman-base-url "https://sjagtap-sat6.satellite.lab.eng.rdu2.redhat.com" --trusted-hosts "sjagtap-sat6.satellite.lab.eng.rdu2.redhat.com" --trusted-hosts "sjagtap-capsule.satellite.lab.eng.rdu2.redhat.com" --oauth-consumer-key "ex3aFNpdYfrR5WXD87BEWEPqadiV9v7Z" --oauth-consumer-secret "UnNrnDWP6RMbM7a9ppcnfPHJzvuxaTWE" --pulp-oauth-secret "UnNrnDWP6RMbM7a9ppcnfPHJzvuxaTWE" --certs-tar "/root/sjagtap-capsule.satellite.lab.eng.rdu2.redhat.com-certs.tar"


Manifest foreman_proxy_plugin_openscap/manifests/init.pp was not found in /usr/share/katello-installer-base/modules, /usr/share/foreman-installer/modules
/usr/share/gems/gems/kafo-0.7.3/lib/kafo/puppet_module.rb:29:in `join': no implicit conversion of nil into String (TypeError)
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/puppet_module.rb:29:in `initialize'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `new'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `block in modules'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `map'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `modules'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:185:in `params'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:194:in `preset_defaults_from_puppet'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/kafo_configure.rb:249:in `set_parameters'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/kafo_configure.rb:102:in `initialize'
	from /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `new'
	from /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/kafo_configure.rb:156:in `run'
	from /usr/sbin/satellite-installer:12:in `<main>'

So, I have to use satellite-installer --scenario capsule as capsule-installer is deprecated.
Is this the correct way for verification?

Comment 7 Corey Welton 2016-06-27 22:47:07 UTC
This does indeed appear to fail :(.  I got the following on snap 17 as well.


 Manifest foreman_proxy_plugin_openscap/manifests/init.pp was not found in /usr/share/katello-installer-base/modules, /usr/share/foreman-installer/modules
/usr/share/gems/gems/kafo-0.7.3/lib/kafo/puppet_module.rb:29:in `join': no implicit conversion of nil into String (TypeError)
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/puppet_module.rb:29:in `initialize'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `new'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `block in modules'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `map'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `modules'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:185:in `params'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/configuration.rb:194:in `preset_defaults_from_puppet'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/kafo_configure.rb:249:in `set_parameters'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/kafo_configure.rb:102:in `initialize'
	from /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `new'
	from /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
	from /usr/share/gems/gems/kafo-0.7.3/lib/kafo/kafo_configure.rb:156:in `run'
	from /usr/sbin/satellite-installer:12:in `<main>'

Comment 8 Corey Welton 2016-06-27 22:54:28 UTC
Although - it is possible the above 2 comments should be in a new bug.  To be discussed offline.

Comment 9 Corey Welton 2016-06-28 16:07:50 UTC
Moving this back to ONQA, with the recognition that it cannot be verified until bug #1350897 is fixed.

Comment 10 Sanket Jagtap 2016-07-13 11:51:50 UTC
Build: Satellite 6.2 snap 19.1

bug #1350897 is Fixed and Verified

Capsule-remove was successfully. 

Capsule was reinstalled successfully without any issues.

Comment 11 Bryan Kearney 2016-07-27 11:12:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501

Comment 12 Djebran Lezzoum 2017-10-23 11:15:32 UTC
qe_test_coverage PR: https://github.com/SatelliteQE/robottelo/pull/5388