summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-server-install
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-05-03 15:21:51 -0400
committerJason Gerard DeRose <jderose@redhat.com>2010-05-03 13:41:18 -0600
commit04e9056ec2b6e0360f3f3545fd638ecc17aaad2c (patch)
treeb9fefef29f7ba68c1932aac39f7b2bedfc85d356 /install/tools/ipa-server-install
parent6d35812252cb4fcf34cf13bf88cbb705560afc3a (diff)
downloadfreeipa-04e9056ec2b6e0360f3f3545fd638ecc17aaad2c.tar.gz
freeipa-04e9056ec2b6e0360f3f3545fd638ecc17aaad2c.tar.xz
freeipa-04e9056ec2b6e0360f3f3545fd638ecc17aaad2c.zip
Make the installer/uninstaller more aware of its state
We have had a state file for quite some time that is used to return the system to its pre-install state. We can use that to determine what has been configured. This patch: - uses the state file to determine if dogtag was installed - prevents someone from trying to re-install an installed server - displays some output when uninstalling - re-arranges the ipa_kpasswd installation so the state is properly saved - removes pkiuser if it was added by the installer - fetches and installs the CA on both masters and clients
Diffstat (limited to 'install/tools/ipa-server-install')
-rwxr-xr-xinstall/tools/ipa-server-install14
1 files changed, 6 insertions, 8 deletions
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index 149cdd783..4fd520a6e 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -375,7 +375,7 @@ def check_dirsrv(unattended):
print "\t636"
sys.exit(1)
-def uninstall(ca=False, dm_password=None):
+def uninstall(dm_password=None):
if dm_password:
api.Backend.ldap2.connect(bind_dn="cn=Directory Manager", bind_pw=dm_password)
@@ -387,13 +387,9 @@ def uninstall(ca=False, dm_password=None):
pass
ntpinstance.NTPInstance(fstore).uninstall()
- if ca:
- try:
- from ipaserver.install import cainstance
- except ImportError:
- print >> sys.stderr, "Import failed: %s" % sys.exc_value
- sys.exit(1)
+ if cainstance.CADSInstance().is_configured():
cainstance.CADSInstance().uninstall()
+ if cainstance.CAInstance().is_configured():
cainstance.CAInstance().uninstall()
bindinstance.BindInstance(fstore).uninstall()
httpinstance.HTTPInstance(fstore).uninstall()
@@ -455,6 +451,8 @@ def main():
else:
standard_logging_setup("/var/log/ipaserver-install.log", options.debug)
print "\nThe log file for this installation can be found in /var/log/ipaserver-install.log"
+ if dsinstance.DsInstance().is_configured() or cainstance.CADSInstance().is_configured():
+ sys.exit("IPA server is already configured on this system.")
global fstore
fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore')
@@ -496,7 +494,7 @@ def main():
sys.exit("\nUnable to connect to LDAP server %s" % api.env.host)
conn.disconnect()
- return uninstall(not certs.ipa_self_signed(), dm_password)
+ return uninstall(dm_password)
# This will override any settings passed in on the cmdline
options._update_loose(read_cache())