summaryrefslogtreecommitdiffstats
path: root/ipaclient/install/ipa_client_install.py
blob: 4ac7cf51f20d0e47195f473cb7c4e0b4e28d1dea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Copyright (C) 2016  FreeIPA Contributors see COPYING for license
#

from ipaclient.install import client
from ipaplatform.paths import paths
from ipapython.install import cli
from ipapython.install.core import knob


class StandaloneClientInstall(client.ClientInstall):
    no_host_dns = False
    no_wait_for_dns = False

    principal = knob(
        bases=client.ClientInstall.principal,
        cli_names=list(client.ClientInstall.principal.cli_names) + ['-p'],
    )

    password = knob(
        str, None,
        sensitive=True,
        description="password to join the IPA realm (assumes bulk password "
                    "unless principal is also set)",
        cli_names=[None, '-w'],
    )

    @property
    def admin_password(self):
        if self.principal:
            return self.password

        return super(StandaloneClientInstall, self).admin_password

    @property
    def host_password(self):
        if not self.principal:
            return self.password

        return super(StandaloneClientInstall, self).host_password

    prompt_password = knob(
        None,
        description="Prompt for a password to join the IPA realm",
        cli_names='-W',
    )

    on_master = knob(
        None,
        deprecated=True,
    )


ClientInstall = cli.install_tool(
    StandaloneClientInstall,
    command_name='ipa-client-install',
    log_file_name=paths.IPACLIENT_INSTALL_LOG,
    debug_option=True,
    verbose=True,
    console_format='%(message)s',
    uninstall_log_file_name=paths.IPACLIENT_UNINSTALL_LOG,
)


def run():
    ClientInstall.run_cli()