[Freeipa-devel] [PATCH 0385] replicainstall: Add possiblity to install client in one

Jan Cholasta jcholast at redhat.com
Tue Dec 1 15:33:29 UTC 2015


On 1.12.2015 16:19, Tomas Babej wrote:
>
>
> On 12/01/2015 08:19 AM, Jan Cholasta wrote:
>> On 30.11.2015 19:17, Simo Sorce wrote:
>>> On Mon, 2015-11-30 at 12:25 +0100, Tomas Babej wrote:
>>>> +    # Perform only if we have the necessary options
>>>> +    if not any([installer.admin_password, installer.keytab]):
>>>> +        sys.exit("IPA client is not configured on this system.\n"
>>>> +                 "You must use a replica file or join the system "
>>>> +                 "either by using by running 'ipa-client-install'. "
>>>> +                 "Alternatively, you may specify enrollment related
>>>> options "
>>>> +                 "directly, see man ipa-replica-install.")
>>>> +
>>>
>>> There is a typo "either by using by "
>>>
>>> Also this seem to be run in promote_check, so you should not mention
>>> replica files, as promotion can only be run at domain level 1 where
>>> replica files cannot be used.
>>
>> One more thing from me: admin password should be passed to
>> ipa-client-install through stdin. Apply the following changes (tested
>> and working) to make it so:
>>
>>               args.extend(["--hostname", installer.host_name])
>>
>>           if installer.admin_password:
>> -            args.extend(["--password", installer.admin_password])
>>               args.extend(["--principal", installer.principal or "admin"])
>>           if installer.keytab:
>>               args.extend(["--keytab", installer.keytab])
>> @@ -792,7 +791,13 @@ def ensure_enrolled(installer):
>>               args.append("--no-sshd")
>>           if installer.mkhomedir:
>>               args.append("--mkhomedir")
>> -        ipautil.run(args)
>> +
>> +        if installer.admin_password:
>> +            stdin = installer.admin_password
>> +        else:
>> +            stdin = None
>> +
>> +        ipautil.run(args, stdin=stdin)
>>       except Exception as e:
>>           sys.exit("Configuration of client side components failed!\n"
>>                    "ipa-client-install returned: " + str(e))
>>
>
> Both Simo's and Jan's suggestions make sense, thanks.
>
> Updated patch attached.

Thank you, ACK.

Pushed to master: 034e76062fd897dc67b5a395735a5471257bfc8b

-- 
Jan Cholasta




More information about the Freeipa-devel mailing list