1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

[PR #11555/71f8c15d backport][stable-12] Allow setting of independent custom domain for incus inventory (#11560)

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.

(cherry picked from commit 71f8c15d2e)

Co-authored-by: Roland Sommer <rol@ndsommer.de>
This commit is contained in:
patchback[bot] 2026-03-07 19:12:30 +01:00 committed by GitHub
parent fc7bcccc9d
commit be7dc5f37d
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 = {}