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:
parent
aaef821f60
commit
71f8c15d2e
3 changed files with 63 additions and 20 deletions
|
|
@ -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 = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue