diff options
-rw-r--r-- | changelogs/fragments/nativejinjatext-yaml-representer.yml | 2 | ||||
-rw-r--r-- | changelogs/fragments/nativejinjaunsafetext-yaml-representer.yml | 2 | ||||
-rw-r--r-- | lib/ansible/parsing/yaml/dumper.py | 12 |
3 files changed, 15 insertions, 1 deletions
diff --git a/changelogs/fragments/nativejinjatext-yaml-representer.yml b/changelogs/fragments/nativejinjatext-yaml-representer.yml new file mode 100644 index 0000000000..ef2f460a09 --- /dev/null +++ b/changelogs/fragments/nativejinjatext-yaml-representer.yml @@ -0,0 +1,2 @@ +bugfixes: + - Add a YAML representer for ``NativeJinjaText`` diff --git a/changelogs/fragments/nativejinjaunsafetext-yaml-representer.yml b/changelogs/fragments/nativejinjaunsafetext-yaml-representer.yml new file mode 100644 index 0000000000..e13486fb30 --- /dev/null +++ b/changelogs/fragments/nativejinjaunsafetext-yaml-representer.yml @@ -0,0 +1,2 @@ +bugfixes: + - Add a YAML representer for ``NativeJinjaUnsafeText`` diff --git a/lib/ansible/parsing/yaml/dumper.py b/lib/ansible/parsing/yaml/dumper.py index 65d35781f7..8701bb8196 100644 --- a/lib/ansible/parsing/yaml/dumper.py +++ b/lib/ansible/parsing/yaml/dumper.py @@ -24,7 +24,7 @@ import yaml from ansible.module_utils.six import text_type, binary_type from ansible.module_utils.common.yaml import SafeDumper from ansible.parsing.yaml.objects import AnsibleUnicode, AnsibleSequence, AnsibleMapping, AnsibleVaultEncryptedUnicode -from ansible.utils.unsafe_proxy import AnsibleUnsafeText, AnsibleUnsafeBytes +from ansible.utils.unsafe_proxy import AnsibleUnsafeText, AnsibleUnsafeBytes, NativeJinjaUnsafeText, NativeJinjaText from ansible.template import AnsibleUndefined from ansible.vars.hostvars import HostVars, HostVarsVars from ansible.vars.manager import VarsWithSources @@ -110,3 +110,13 @@ AnsibleDumper.add_representer( AnsibleUndefined, represent_undefined, ) + +AnsibleDumper.add_representer( + NativeJinjaUnsafeText, + represent_unicode, +) + +AnsibleDumper.add_representer( + NativeJinjaText, + represent_unicode, +) |