Merge pull request #1099 from rjeffman/roles_disallow_fqdn_domain_match

Don't allow the FQDN to match the domain on server installs
This commit is contained in:
Thomas Woerner
2023-06-07 16:56:06 +02:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -521,6 +521,11 @@ def main():
ansible_module.fail_json(
msg="NTP configuration cannot be updated during promotion")
# host_name an domain_name must be different at this point.
if options.host_name.lower() == options.domain_name.lower():
ansible_module.fail_json(
msg="hostname cannot be the same as the domain name")
# done #
ansible_module.exit_json(

View File

@@ -1055,6 +1055,11 @@ def main():
domain_name = domain_name.lower()
# Both host_name and domain_name are lowercase at this point.
if host_name == domain_name:
ansible_module.fail_json(
msg="hostname cannot be the same as the domain name")
if not options.realm_name:
realm_name = domain_name.upper()
else: