mirror of https://github.com/ansible/ansible.git
(cherry picked from commit 181dbdb)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
pull/85618/head
parent
d58c99ddd4
commit
e8272f1038
@ -0,0 +1,3 @@
|
||||
---
|
||||
minor_changes:
|
||||
- encrypt - check datatype of salt_size in password_hash filter.
|
||||
@ -0,0 +1,28 @@
|
||||
# Copyright: Contributors to the Ansible project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
- name: Check if to_json works
|
||||
set_fact:
|
||||
msg: "{{ list_one | to_json }}"
|
||||
vars:
|
||||
list_one:
|
||||
- one
|
||||
- two
|
||||
register: json_01
|
||||
|
||||
- name: Check if to_nice_json works
|
||||
set_fact:
|
||||
msg: "{{ list_one | to_json }}"
|
||||
vars:
|
||||
list_one:
|
||||
- one
|
||||
- two
|
||||
register: json_02
|
||||
|
||||
- name: Assert
|
||||
assert:
|
||||
that:
|
||||
- not json_01.failed
|
||||
- json_01.ansible_facts.msg == "[\"one\", \"two\"]"
|
||||
- not json_02.failed
|
||||
- json_02.ansible_facts.msg == "[\"one\", \"two\"]"
|
||||
@ -0,0 +1,27 @@
|
||||
# Copyright: Contributors to the Ansible project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
- name: Check to_yaml exception handling
|
||||
set_fact:
|
||||
msg: "{{ 'thing' | to_yaml(nonexistent_argument=True) }}"
|
||||
register: yaml_test_01
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Check default_style
|
||||
set_fact:
|
||||
msg: "{{ 'thing' | to_yaml(default_style='|') }}"
|
||||
register: yaml_test_02
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Check canonical
|
||||
set_fact:
|
||||
msg: "{{ 'thing' | to_yaml(canonical=True) }}"
|
||||
register: yaml_test_03
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Test to_yaml
|
||||
assert:
|
||||
that:
|
||||
- yaml_test_01.failed
|
||||
- yaml_test_02.ansible_facts.msg == "|-\n thing\n"
|
||||
- yaml_test_03.ansible_facts.msg == "---\n!!str \"thing\"\n"
|
||||
Loading…
Reference in New Issue