library/ipaclient_get_otp: Enable force mode for host_add call

When OTP is used for installation of a client or the client part of
a replica and also there is no DNS record for the client, then
ipaclient_get_otp fails in the host_add call.

With the force mode the host_add call will ignore the missing DNS
record and will properly add the host. The host information and also
the DNS record will be updated while deploying the client according
to the given settings.

Fixes: #74 (ipaclient fails when ipaclient_use_otp is true and client ..)
This commit is contained in:
Thomas Woerner
2019-07-11 18:36:47 +02:00
parent 8cd34b4d53
commit 1fa1468b85

View File

@@ -265,6 +265,8 @@ def ensure_host_present(module, api, ipahost):
# Must add the user
module_host = get_module_host(module)
# force creation of host even if there is no DNS record
module_host["force"] = True
result = api.Command.host_add(fqdn, **module_host)
# Save random password as it is not displayed by host-show
if module.params.get('random'):