freeipa / ansible-freeipa

Ansible roles and modules for FreeIPA
GNU General Public License v3.0
489 stars 232 forks source link

ipaclient install role hostname returned does not match external DNS. CLI install with --hostname option works fine. #1271

Closed knowtown closed 1 month ago

knowtown commented 1 month ago

I am working with an install where DNS is external and some of the A records are uppercase. When we do an ipa-client install with --hostname and pass the lowercase hostname the install works but when we attempt to install using the ipaclient role, we encounter an error that the hostname must be lowercase. It appears that the hostname variable used in the client install role comes from line 58 in install.yml: hostname: "{{ ipaclient_hostname | default(ansible_facts['fqdn']) }}"

We have added a host record to the client's /etc/hosts but this does not appear to work.

Is there a variable we can set to convert this to lowercase so it behaves the same way the command line install works when we pass the --hostname option?

knowtown commented 1 month ago

I also see line 22 in utils/gen_module_docs.py shows:

"_hostname_overridden": "The installer _hostname_overridden setting", 

but I see I am not clear where/how that gets used or how to call it or set it. Is it possible to pass that _hostname_overridden as an extra var that lowercases hostname in the ipa-client-install? such as:

"_hostname_overridden='{{ ipaclient_hostname | default(ansible_facts['fqdn']) | lower }}'"

we tested hard coding hostname to that value above in the ipa-client-install but prefer not to change it there if there is a know option to override that with the lowercase value.

knowtown commented 1 month ago

We got this working using the variables above.