mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 13:53:23 +00:00
hbacrule: Create FQDN from single hostnames
Single hostnames can be used for hbacrule_add_host and will match fqdn in IPA internally. Simple host names have to be extended to be FQDN to be able to compare them for _host_add and _host_remove. Two new functions have been added to ansible_freeipa_module: - api_get_domain - Get the domain from the api - ensure_fqdn - Extend a single name with the domain This fixes #617 - hbacrule_add_host: already a member
This commit is contained in:
@@ -370,6 +370,14 @@ else:
|
||||
def module_params_get(module, name):
|
||||
return _afm_convert(module.params.get(name))
|
||||
|
||||
def api_get_domain():
|
||||
return api.env.domain
|
||||
|
||||
def ensure_fqdn(name, domain):
|
||||
if "." not in name:
|
||||
return "%s.%s" % (name, domain)
|
||||
return name
|
||||
|
||||
def api_get_realm():
|
||||
return api.env.realm
|
||||
|
||||
|
||||
Reference in New Issue
Block a user