client install: split off SSSD options into a separate class

Split off SSSD knob definitions from the ClientInstallInterface class into
a new SSSDInstallInterface class.

https://pagure.io/freeipa/issue/6392

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Jan Cholasta 2017-03-08 08:01:41 +00:00 committed by Martin Basti
parent 94f362d7b0
commit 1cfe06c79e
2 changed files with 55 additions and 41 deletions

View File

@ -63,7 +63,7 @@ from ipapython.ipautil import (
)
from ipapython.ssh import SSHPublicKey
from . import automount, ipadiscovery, ntpconf
from . import automount, ipadiscovery, ntpconf, sssd
from .ipachangeconf import IPAChangeConf
NoneType = type(None)
@ -3356,7 +3356,8 @@ def init(installer):
class ClientInstallInterface(hostname_.HostNameInstallInterface,
service.ServiceAdminInstallInterface):
service.ServiceAdminInstallInterface,
sssd.SSSDInstallInterface):
"""
Interface of the client installer
@ -3367,12 +3368,6 @@ class ClientInstallInterface(hostname_.HostNameInstallInterface,
* ipa-replica-install
"""
fixed_primary = knob(
None,
description="Configure sssd to use fixed server as primary IPA server",
)
fixed_primary = enroll_only(fixed_primary)
principal = knob(
bases=service.ServiceAdminInstallInterface.principal,
description="principal to use to join the IPA realm",
@ -3487,32 +3482,6 @@ class ClientInstallInterface(hostname_.HostNameInstallInterface,
)
request_cert = prepare_only(request_cert)
permit = knob(
None,
description="disable access rules by default, permit all access.",
)
permit = enroll_only(permit)
enable_dns_updates = knob(
None,
description="Configures the machine to attempt dns updates when the "
"ip address changes.",
)
enable_dns_updates = enroll_only(enable_dns_updates)
no_krb5_offline_passwords = knob(
None,
description="Configure SSSD not to store user password when the "
"server is offline",
)
no_krb5_offline_passwords = enroll_only(no_krb5_offline_passwords)
preserve_sssd = knob(
None,
description="Preserve old SSSD configuration if possible",
)
preserve_sssd = enroll_only(preserve_sssd)
def __init__(self, **kwargs):
super(ClientInstallInterface, self).__init__(**kwargs)
@ -3605,13 +3574,6 @@ class ClientInstall(ClientInstallInterface,
"example: '/usr/lib/firefox')",
)
no_sssd = knob(
None,
description="Do not configure the client to use SSSD for "
"authentication",
cli_names=[None, '-S'],
)
def __init__(self, **kwargs):
super(ClientInstall, self).__init__(**kwargs)

52
ipaclient/install/sssd.py Normal file
View File

@ -0,0 +1,52 @@
#
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
from ipalib.install import service
from ipalib.install.service import enroll_only
from ipapython.install.core import group, knob
@group
class SSSDInstallInterface(service.ServiceInstallInterface):
description = "SSSD"
fixed_primary = knob(
None,
description="Configure sssd to use fixed server as primary IPA server",
)
fixed_primary = enroll_only(fixed_primary)
permit = knob(
None,
description="disable access rules by default, permit all access.",
)
permit = enroll_only(permit)
enable_dns_updates = knob(
None,
description="Configures the machine to attempt dns updates when the "
"ip address changes.",
)
enable_dns_updates = enroll_only(enable_dns_updates)
no_krb5_offline_passwords = knob(
None,
description="Configure SSSD not to store user password when the "
"server is offline",
)
no_krb5_offline_passwords = enroll_only(no_krb5_offline_passwords)
preserve_sssd = knob(
None,
description="Preserve old SSSD configuration if possible",
)
preserve_sssd = enroll_only(preserve_sssd)
no_sssd = knob(
None,
description="Do not configure the client to use SSSD for "
"authentication",
cli_names=[None, '-S'],
)
no_sssd = enroll_only(no_sssd)