mirror of https://github.com/ansible/ansible.git
Be strict about what is a boolean for keywords (#67625)
* be strict about what is a boolean for keywords - found and fixed typo in test , 'yes' != 'yes.'pull/68474/head
parent
7714f691eb
commit
babac66f9c
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- Ensure that keywords defined as booleans are correctly interpreting their input, before patch any random string would be interpreted as False
|
@ -0,0 +1 @@
|
||||
shippable/posix/group1
|
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
# run type tests
|
||||
ansible-playbook -i ../../inventory types.yml -v "$@"
|
@ -0,0 +1,21 @@
|
||||
- hosts: testhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: try to set 'diff' a boolean
|
||||
debug: msg="not important"
|
||||
diff: yes
|
||||
ignore_errors: True
|
||||
register: good_diff
|
||||
|
||||
- name: try to set 'diff' a boolean to a string (. would make it non boolean)
|
||||
debug: msg="not important"
|
||||
diff: yes.
|
||||
ignore_errors: True
|
||||
register: bad_diff
|
||||
|
||||
- name: Check we did error out
|
||||
assert:
|
||||
that:
|
||||
- good_diff is success
|
||||
- bad_diff is failed
|
||||
- "'is not a valid boolean' in bad_diff['msg']"
|
Loading…
Reference in New Issue