aruba: use the hostname, not the FQDN

pull/103/head
jeltz 2 years ago
parent 1d4534f19c
commit 89d22feba1
Signed by: jeltz
GPG Key ID: 800882B66C0C3326

@ -8,6 +8,7 @@ class FilterModule:
def filters(self):
return {
"remove_domain_suffix": remove_domain_suffix,
"hostname": hostname,
"ipaddr_sort": ipaddr_sort,
}
@ -17,6 +18,11 @@ def remove_domain_suffix(name):
return parent.to_text()
def hostname(fqdn):
name = dns.name.from_text(fqdn)
return name.relativize(name.parent()).to_text()
def ipaddr_sort(addrs, types, unknown_after=True):
check_types = {
"global": attrgetter("is_global"),

@ -1,6 +1,6 @@
{{ ansible_managed | comment(decoration="; ") }}
hostname {{ aruba__hostname | truncate(32) | enquote }}
hostname {{ aruba__hostname | hostname | truncate(32) | enquote }}
include-credentials

Loading…
Cancel
Save