Add Environment Helpers installer framework
authorSimo Sorce <simo@redhat.com>
Mon, 28 Apr 2014 17:58:51 +0000 (13:58 -0400)
committerSimo Sorce <simo@redhat.com>
Fri, 2 May 2014 01:05:47 +0000 (21:05 -0400)
Environment helpers are meta-plugins that allow to set ipsilon in
well defined environments.
For example when ipsilon is install in a FreeIPA or AD domains and
authentication methods, cetificate, keytabs etc, can be pre-configured
and deployed at the same time the server is installed with minimal
effort and wellknown methods.

These are run before any of the other plugins as they can chage the
configuration option for any of the plugins, enable or disable plugins,
or pre-configure some elements.

Signed-off-by: Simo Sorce <simo@redhat.com>
ipsilon/helpers/__init__.py [new file with mode: 0644]
ipsilon/helpers/common.py [new file with mode: 0755]
ipsilon/install/ipsilon-server-install

diff --git a/ipsilon/helpers/__init__.py b/ipsilon/helpers/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ipsilon/helpers/common.py b/ipsilon/helpers/common.py
new file mode 100755 (executable)
index 0000000..6ec2819
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2014  Simo Sorce <simo@redhat.com>
+#
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from ipsilon.util.plugin import PluginInstaller
+
+
+class EnvHelpersInstall(object):
+
+    def __init__(self):
+        pi = PluginInstaller(EnvHelpersInstall)
+        self.plugins = pi.get_plugins()
index d9e4585..ce78aba 100755 (executable)
@@ -19,6 +19,7 @@
 
 from ipsilon.login.common import LoginMgrsInstall
 from ipsilon.providers.common import ProvidersInstall
 
 from ipsilon.login.common import LoginMgrsInstall
 from ipsilon.providers.common import ProvidersInstall
+from ipsilon.helpers.common import EnvHelpersInstall
 from ipsilon.util.data import Store
 from ipsilon.tools import files
 import argparse
 from ipsilon.util.data import Store
 from ipsilon.tools import files
 import argparse
@@ -125,6 +126,11 @@ def install(plugins, args):
     db = Store()
     db.save_user_preferences(args['admin_user'], {'is_admin': 1})
 
     db = Store()
     db.save_user_preferences(args['admin_user'], {'is_admin': 1})
 
+    logger.info('Configuring environment helpers')
+    for plugin_name in plugins['Environment Helpers']:
+        plugin = plugins['Environment Helpers'][plugin_name]
+        plugin.configure_server(args)
+
     logger.info('Configuring login managers')
     for plugin_name in args['lm_order']:
         plugin = plugins['Login Managers'][plugin_name]
     logger.info('Configuring login managers')
     for plugin_name in args['lm_order']:
         plugin = plugins['Login Managers'][plugin_name]
@@ -150,6 +156,7 @@ def uninstall(plugins, args):
 
 def find_plugins():
     plugins = {
 
 def find_plugins():
     plugins = {
+        'Environment Helpers': EnvHelpersInstall().plugins,
         'Login Managers': LoginMgrsInstall().plugins,
         'Auth Providers': ProvidersInstall().plugins
     }
         'Login Managers': LoginMgrsInstall().plugins,
         'Auth Providers': ProvidersInstall().plugins
     }
@@ -170,8 +177,6 @@ def parse_args(plugins):
                         help="User account used to run the server")
     parser.add_argument('--admin-user', default='admin',
                         help="User account that is assigned admin privileges")
                         help="User account used to run the server")
     parser.add_argument('--admin-user', default='admin',
                         help="User account that is assigned admin privileges")
-    parser.add_argument('--ipa', choices=['yes', 'no'], default='yes',
-                        help='Detect and use an IPA server for authentication')
     parser.add_argument('--uninstall', action='store_true',
                         help="Uninstall the server and all data")
 
     parser.add_argument('--uninstall', action='store_true',
                         help="Uninstall the server and all data")