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:
parent
fc7bcccc9d
commit
be7dc5f37d
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