mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Implement omit for module args, also add tests for it
This commit is contained in:
parent
bce6642ab6
commit
559c04f324
4 changed files with 46 additions and 21 deletions
|
@ -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"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue