You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/filter_plugins/net_utils.py

14 lines
255 B
Python

import dns.name
class FilterModule:
def filters(self):
return {
"remove_domain_suffix": remove_domain_suffix,
}
def remove_domain_suffix(name):
parent = dns.name.from_text(name).parent()
return parent.to_text()