Bug 1327442 - Satellite 6.2 Beta: capsule-remove doesn't remove foreman-installer configs, which causes failure of next capsule install
Summary: Satellite 6.2 Beta: capsule-remove doesn't remove foreman-installer configs, ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Foreman Proxy
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: Chris Roberts
QA Contact: Sanket Jagtap
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1315159 1336270 (view as bug list)
Depends On: 1350897
Blocks: GSS_Sat6Beta_Tracker, GSS_Sat6_Tracker
TreeView+ depends on / blocked
 
Reported: 2016-04-15 07:38 UTC by Pradeep Kumar Surisetty
Modified: 2019-11-14 07:47 UTC (History)
10 users (show)

Fixed In Version: katello-installer-base-3.0.0.22-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:12:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14906 0 Normal Closed capsule-remove doesn't remove foreman-installer configs and old certs which causes failure of next capsule install 2020-10-06 14:34:03 UTC

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


Note You need to log in before you can comment on or make changes to this bug.