community.dns.remove_registrable_domain 过滤器 – 从 DNS 名称中移除可注册域名
注意
此过滤器插件是 community.dns 集合 (版本 3.1.0) 的一部分。
如果您正在使用 ansible
包,您可能已经安装了这个集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install community.dns
。
要在 playbook 中使用它,请指定: community.dns.remove_registrable_domain
。
community.dns 0.1.0 中的新增功能
概要
从 DNS 名称中移除可注册域名。
输入
这描述了过滤器的输入,即 | community.dns.remove_registrable_domain
之前的值。
关键字参数
这描述了过滤器的关键字参数。这些是以下示例中 key1=value1
、key2=value2
等值: input | community.dns.remove_registrable_domain(key1=value1, key2=value2, ...)
参数 |
注释 |
---|---|
这控制是否仅使用公共后缀列表的 ICANN 部分中的条目,或者也使用私有部分中的条目。例如, 选择
|
|
这控制是否保留前缀(即可注册域名之前的部分)的尾随句点。 选择
|
|
这会将未知的 TLD 视为有效的公共后缀。因此,例如,如果这是 此选项对应于是否使用公共后缀列表中的全局通配符规则 选择
|
|
这控制在公共后缀前面没有标签时的行为。如果 DNS 名称本身是公共后缀,则会出现这种情况。 如果设置为 如果设置为 选择
|
示例
- name: Remove the registrable domain from a DNS name
ansible.builtin.set_fact:
public_suffix: "{{ 'www.ansible.co.uk' | community.dns.remove_registrable_domain }}"
# Should result in 'www'