Bug 767750

Summary: [RFE] Provide utility to uninstall or remove Katello and all components
Product: [Retired] Katello Reporter: james labocki <jlabocki>
Component: InstallerAssignee: Lukas Zapletal <lzap>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: low    
Version: 2.0CC: bkearney, ehelms, ftaylor, mmccune
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: 1.x   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-18 15:21:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description james labocki 2011-12-14 19:57:33 UTC
This is a request for a utility to allow for the uninstallation and/or removal of Katello and it's related components from a system. A good example of the desired functionality can be found in the following script:

https://raw.github.com/gist/1308881/41588442020685da6c55e446e65b94a3e8f10f25/katello_remove.sh

Comment 1 Forrest Taylor 2012-02-09 23:30:14 UTC
Can we clean this script up a bit before we include it?  At least the `grep -v grep` and the `rpm -qa|grep` inside the yum commands.  How about this:


service mongod stop; service pulp-server stop; service tomcat6 stop; service katello stop; service katello-jobs stop

kill -9 `ps -aef | grep [k]atello  awk '{print $2}'`
kill -9 `ps -aef | grep [d]elayed_job | awk '{print $2}'`
#...or maybe just `killall -9 katello delayed_job`

yum erase -y 'candlepin*' 'katello*' 'pulp*' 'mongodb*' '*postgres*' 'httpd*' 'mod_*' puppet tomcat6 'ruby*'

# config files
rm -rf /etc/pulp/ /etc/candlepin/ /etc/katello/ /usr/share/katello/ /var/lib/puppet/ /var/lib/pgsql/ /var/lib/mongodb/ /var/lib/katello/ /var/lib/pulp/ /etc/httpd/ /etc/tomcat6/ /var/lib/candlepin/

# logs
rm -rf /var/log/katello/ /var/log/tomcat6/ /var/log/pulp/ /var/log/candlepin/ /var/log/httpd/ /var/log/mongodb/

# pulp cert stuff
rm -rf /etc/pki/pulp/ /etc/pki/content/*

Comment 2 Forrest Taylor 2012-02-13 15:07:41 UTC
Oops, I forgot a pipe (|) in the first kill command.  It should read:

kill -9 `ps -aef | grep [k]atello | awk '{print $2}'`

Comment 3 Forrest Taylor 2012-03-23 01:21:26 UTC
The /root/ssl-build directory should be removed.  Otherwise there are errors about the candlepin certificate.

ADD:   rm -rf /root/ssl-build/

Comment 4 Lukas Zapletal 2012-03-23 09:56:08 UTC
Link just for a reference:

http://git.fedorahosted.org/git/?p=katello.git;a=blob;f=scripts/katello_remove.sh

Comment 7 Mike McCune 2012-05-08 18:36:28 UTC
if the user only wants to reset the data associated with Katello they can run:

/usr/share/katello/script/katello-reset-dbs

this resets:

 * pulp's database
 * candlepin's database
 * katello's database

and restarts all services

Comment 8 Lukas Zapletal 2012-12-18 15:21:13 UTC
For re-deployments there is officially supported katello-configure --reset-data=YES option.

For removal, there is a script in our git:

http://git.fedorahosted.org/git/?p=katello.git;a=blob;f=scripts/katello_remove.sh

I am closing this. Reopen if you need to distribute the removal script, but I have to say it is not super clean - I'd rather not distribute it at all.