diff options
author | Karl MacMillan <kmacmill@redhat.com> | 2007-11-05 14:42:11 -0500 |
---|---|---|
committer | Karl MacMillan <kmacmill@redhat.com> | 2007-11-05 14:42:11 -0500 |
commit | 8e48393c61397e80f7d8d29d5b48d97988aa6c84 (patch) | |
tree | 06f0868a03db8d2554acf926a61e4d3555c029a2 /ipa-server/ipa-install/ipa-server-install | |
parent | 957a70e560c2109d9cd788327fa18918294c29d7 (diff) | |
download | freeipa-8e48393c61397e80f7d8d29d5b48d97988aa6c84.tar.gz freeipa-8e48393c61397e80f7d8d29d5b48d97988aa6c84.tar.xz freeipa-8e48393c61397e80f7d8d29d5b48d97988aa6c84.zip |
Introduce service base class and clean up ipa-server-install
1) Add a base class for all of the instance objects.
2) Normalize usage of logging.
3) General cleanups of ipa-server-install.
4) Make better use of httpinstance.
5) Add webguiinstance.
6) Improve progress reporting during installation.
Works Here (TM), but it would be nice to get someone else
to test since this moves code around a bit.
Diffstat (limited to 'ipa-server/ipa-install/ipa-server-install')
-rw-r--r-- | ipa-server/ipa-install/ipa-server-install | 68 |
1 files changed, 11 insertions, 57 deletions
diff --git a/ipa-server/ipa-install/ipa-server-install b/ipa-server/ipa-install/ipa-server-install index 107c0d368..2de687fd7 100644 --- a/ipa-server/ipa-install/ipa-server-install +++ b/ipa-server/ipa-install/ipa-server-install @@ -48,6 +48,9 @@ import ipaserver.bindinstance import ipaserver.httpinstance import ipaserver.ntpinstance import ipaserver.radiusinstance +import ipaserver.webguiinstance + +from ipaserver import service from ipa.ipautil import run @@ -525,7 +528,11 @@ def main(): # Create a HTTP instance http = ipaserver.httpinstance.HTTPInstance() - http.create_instance() + http.create_instance(realm_name, host_name) + + # Create a Web Gui instance + webgui = ipaserver.webguiinstance.WebGuiInstance() + webgui.create_instance() # Create a radius instance radius = ipaserver.radiusinstance.RadiusInstance() @@ -548,69 +555,16 @@ def main(): bind.create_sample_bind_zone() # Restart ds and krb after configurations have been changed + service.print_msg("restarting the directory server") ds.restart() + + service.print_msg("restarting the KDC") krb.restart() # Configure ntpd ntp = ipaserver.ntpinstance.NTPInstance() ntp.create_instance() - try: - selinux=0 - try: - if (os.path.exists('/usr/sbin/selinuxenabled')): - run(["/usr/sbin/selinuxenabled"]) - selinux=1 - except subprocess.CalledProcessError, e: - # selinuxenabled returns 1 if not enabled - pass - - if selinux: - # Allow apache to connect to the turbogears web gui - # This can still fail even if selinux is enabled - try: - run(["/usr/sbin/setsebool", "-P", "httpd_can_network_connect", "true"]) - except: - print "WARNING: could not set selinux boolean httpd_can_network_connect to true." - print "The web interface may not function correctly until this boolean is" - print "successfully change with the command:" - print " /usr/sbin/setsebool -P httpd_can_network_connect true" - print "Try updating the policycoreutils and selinux-policy packages." - pass - - # Start the web gui - run(["/sbin/service", "ipa-webgui", "start"]) - - # Set the web gui to start on boot - run(["/sbin/chkconfig", "ipa-webgui", "on"]) - - # Restart apache - run(["/sbin/service", "httpd", "restart"]) - - # Set apache to start on boot - run(["/sbin/chkconfig", "httpd", "on"]) - - # Set fedora-ds to start on boot - run(["/sbin/chkconfig", "dirsrv", "on"]) - - # Set the KDC to start on boot - run(["/sbin/chkconfig", "krb5kdc", "on"]) - - # Set the Kpasswd to start on boot - run(["/sbin/chkconfig", "ipa-kpasswd", "on"]) - - # Start Kpasswd - run(["/sbin/service", "ipa-kpasswd", "start"]) - - # Set the ntpd to start on boot - run(["/sbin/chkconfig", "ntpd", "on"]) - - # Restart ntpd - run(["/sbin/service", "ntpd", "restart"]) - except subprocess.CalledProcessError, e: - print "Installation failed:", e - return 1 - # Set the admin user kerberos password ds.change_admin_password(admin_password) |