community.dns.quote_txt filter – Quotes a string to use as a TXT record entry
Note
This filter plugin is part of the community.dns collection (version 3.1.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.dns
.
To use it in a playbook, specify: community.dns.quote_txt
.
New in community.dns 2.9.0
Synopsis
Given a string, quotes it so it can be used in a TXT record entry.
Input
This describes the input of the filter, the value before | community.dns.quote_txt
.
Parameter |
Comments |
---|---|
The string to quote. |
Keyword parameters
This describes keyword parameters of the filter. These are the values key1=value1
, key2=value2
and so on in the following
example: input | community.dns.quote_txt(key1=value1, key2=value2, ...)
Parameter |
Comments |
---|---|
Whether to always quote the resulting string in double quotes. Choices:
|
|
Whether to treat numeric escape sequences ( The default value Choices:
|
Examples
- name: Quote a TXT entry
ansible.builtin.set_fact:
public_suffix: "{{ value | community.dns.quote_txt }}"
# Should result in '"this is a test"'
vars:
value: this is a test
Return Value
Key |
Description |
---|---|
The quoted string that can be used for a TXT entry. Returned: success |