Merge pull request #674 from rjeffman/sudorule_fix_host_order

sudorule: Create FQDN from single hostnames
This commit is contained in:
Thomas Woerner
2022-01-12 16:10:21 +01:00
committed by GitHub
2 changed files with 159 additions and 1 deletions

View File

@@ -188,7 +188,7 @@ RETURN = """
from ansible.module_utils.ansible_freeipa_module import \
IPAAnsibleModule, compare_args_ipa, gen_add_del_lists, gen_add_list, \
gen_intersection_list
gen_intersection_list, api_get_domain, ensure_fqdn
def find_sudorule(module, name):
@@ -374,6 +374,13 @@ def main():
# Connect to IPA API
with ansible_module.ipa_connect():
default_domain = api_get_domain()
# Ensure host is not short hostname.
if host:
host = list(
{ensure_fqdn(value.lower(), default_domain) for value in host}
)
commands = []