community.dns.remove_registrable_domain (2.8.3) — filter

Removes the registrable domain name from a DNS name

| "added in version" 0.1.0 of community.dns"

Authors: Felix Fontein (@felixfontein)

Install collection

Install with ansible-galaxy collection install community.dns:==2.8.3


Add to requirements.yml

  collections:
    - name: community.dns
      version: 2.8.3

Description

Removes the registrable domain name from a DNS name.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove the registrable domain from a DNS name
  ansible.builtin.set_fact:
    public_suffix: "{{ 'www.ansible.co.uk' | community.dns.remove_registrable_domain }}"

Inputs

    
_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

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

keep_trailing_period:
    default: false
    description:
    - This controls whether the trailing period of the prefix (that is, the part before
      the registrable domain) is preserved 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

Outputs

_value:
  description: The part of the DNS name before the registrable domain.
  type: string