WIP: Aruba switches #103

Draft
jeltz wants to merge 10 commits from aruba into master
2 changed files with 7 additions and 1 deletions
Showing only changes of commit 89d22feba1 - Show all commits

View file

@ -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"),

View file

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