community / community.dns / 2.8.3 / filter / get_registrable_domain Returns the registrable domain name of a DNS name | "added in version" 0.1.0 of community.dns" Authors: Felix Fontein (@felixfontein)community.dns.get_registrable_domain (2.8.3) — filter
Install with ansible-galaxy collection install community.dns:==2.8.3
collections: - name: community.dns version: 2.8.3
Returns the registrable domain name of a DNS name.
- name: Extract the registrable domain from a DNS name ansible.builtin.set_fact: public_suffix: "{{ 'www.ansible.co.uk' | community.dns.get_registrable_domain }}"
_input: description: - A DNS name. required: true type: string icann_only: default: false description: - This controls whether only entries from the ICANN section of the Public Suffix List are used, or also entries from the Private section. For example, C(.co.uk) is in the ICANN section, but C(github.io) is in the Private section. type: boolean normalize_result: default: false description: - "This controls whether the result is reconstructed from the normalized name used\ \ during lookup. During normalization, ulabels are converted to alabels, and every\ \ label is converted to lowercase. For example, the ulabel C(\xEB\xE7\xE3mpl\xEA\ ) is converted to C(xn--mpl-llatwb) (puny-code), and C(Example.COM) is converted\ \ to C(example.com)." type: boolean keep_unknown_suffix: default: true description: - This treats unknown TLDs as valid public suffixes. So for example the public suffix of C(example.tlddoesnotexist) is C(.tlddoesnotexist) if this is V(true), and hence the registrable domain of C(www.example.tlddoesnotexist) is C(example.tlddoesnotexist). If set to V(false), the registrable domain of C(www.example.tlddoesnotexist) is C(tlddoesnotexist). - This option corresponds to whether the global wildcard rule C(*) in the Public Suffix List is used or not. type: boolean only_if_registerable: default: true description: - This controls the behavior in case there is no label in front of the public suffix. This is the case if the DNS name itself is a public suffix. - If set to V(false), in this case the public suffix is treated as a registrable domain. - If set to V(true) (default), the registrable domain of a public suffix is interpreted as an empty string. type: boolean
_value: description: The registrable domain. type: string