mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-06 21:33:14 +00:00
library/ipadiscovery.py: Allow to use server only also
The discovery was not working if a server has been specified. The domain has been needed additionally. The domain is now gathered from the server name if it is missing in this case.
This commit is contained in:
@@ -226,6 +226,10 @@ def main():
|
||||
module.fail_json(
|
||||
msg="Invalid hostname, '%s' must not be used." % hostname)
|
||||
|
||||
# Get domain from first server if domain is not set, but there are servers
|
||||
if opt_domain is None and len(opt_servers) > 0:
|
||||
opt_domain = opt_servers[0][opt_servers[0].find(".")+1:]
|
||||
|
||||
# Create the discovery instance
|
||||
ds = ipadiscovery.IPADiscovery()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user