1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-21 20:59:10 +00:00

Allow setting of independent custom domain for incus inventory (#11555)

Allowing the domain suffix to be appended independent of the `host_fqdn`
setting enables the inventory plugin to construct proper FQDNs if a
network has the `dns.domain` property set. Otherwise you would always
end up with something like `host01.project.local.example.net` despite
`host01.example.net` being the expected result.
This commit is contained in:
Roland Sommer 2026-03-07 14:15:07 +01:00 committed by GitHub
parent aaef821f60
commit 71f8c15d2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 63 additions and 20 deletions

View file

@ -34,7 +34,8 @@ options:
default: []
host_domain:
description:
- Domain to append to the host FQDN.
- Domain to append to the host.
- This is also used when O(host_fqdn) is not set since community.general 12.5.0.
type: string
host_fqdn:
description:
@ -170,9 +171,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
if self.get_option("host_fqdn"):
host_name = f"{host_name}.{project}.{remote_name}"
domain = self.get_option("host_domain")
if domain:
host_name = f"{host_name}.{domain}"
domain = self.get_option("host_domain")
if domain:
host_name = f"{host_name}.{domain}"
# Add some extra variables.
host_vars = {}