Implement omit for module args, also add tests for it

This commit is contained in:
Victor Lin 2014-08-01 22:11:42 -07:00 committed by James Cammarata
commit 559c04f324
4 changed files with 46 additions and 21 deletions

View file

@ -172,3 +172,32 @@
assert:
that:
- nested_include_var is undefined
- name: test omit in complex args
set_fact:
foo: bar
spam: "{{ omit }}"
should_not_omit: "prefix{{ omit }}"
- assert:
that:
- foo == 'bar'
- spam is undefined
- should_not_omit == "prefix{{ omit }}"
- name: test omit in module args
set_fact: >
yo=whatsup
eggs="{{ omit }}"
default_omitted="{{ not_exists|default(omit) }}"
should_not_omit_1="prefix{{ omit }}"
should_not_omit_2="{{ omit }}suffix"
- assert:
that:
- yo == 'whatsup'
- eggs is undefined
- default_omitted is undefined
- should_not_omit_1 == "prefix{{ omit }}"
- should_not_omit_2 == "{{ omit }}suffix"