2020-09-22 17:33:59 +02:00
|
|
|
- argspec:
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
state: present
|
|
|
|
register: argspec_required_if_fail
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
state: present
|
|
|
|
path: foo
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
state: present
|
|
|
|
content: foo
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
state: present
|
|
|
|
content: foo
|
|
|
|
path: foo
|
|
|
|
register: argspec_mutually_exclusive_fail
|
|
|
|
ignore_errors: true
|
|
|
|
|
2020-09-30 15:56:27 +02:00
|
|
|
- argspec:
|
|
|
|
mapping:
|
|
|
|
foo: bar
|
|
|
|
register: argspec_good_mapping
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
mapping: foo=bar
|
|
|
|
register: argspec_good_mapping_kv
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
mapping: !!str '{"foo": "bar"}'
|
|
|
|
register: argspec_good_mapping_json
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
mapping: foo
|
|
|
|
register: argspec_bad_mapping_string
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
mapping: 1
|
|
|
|
register: argspec_bad_mapping_int
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
mapping:
|
|
|
|
- foo
|
|
|
|
- bar
|
|
|
|
register: argspec_bad_mapping_list
|
|
|
|
ignore_errors: true
|
|
|
|
|
2020-09-30 22:38:12 +02:00
|
|
|
- argspec:
|
|
|
|
required_together:
|
|
|
|
- thing: foo
|
|
|
|
other: bar
|
|
|
|
another: baz
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_together:
|
|
|
|
- another: baz
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_together:
|
|
|
|
- thing: foo
|
|
|
|
register: argspec_required_together_fail
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_together:
|
|
|
|
- thing: foo
|
|
|
|
other: bar
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_if:
|
|
|
|
- thing: bar
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_if:
|
|
|
|
- thing: foo
|
|
|
|
other: bar
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_if:
|
|
|
|
- thing: foo
|
|
|
|
register: argpsec_required_if_fail
|
|
|
|
ignore_errors: true
|
|
|
|
|
2020-10-02 21:53:09 +02:00
|
|
|
- argspec:
|
|
|
|
json: !!str '{"foo": "bar"}'
|
|
|
|
register: argspec_good_json_string
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
json:
|
|
|
|
foo: bar
|
|
|
|
register: argspec_good_json_dict
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
json: 1
|
|
|
|
register: argspec_bad_json
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
fail_on_missing_params:
|
|
|
|
- needed_param
|
|
|
|
needed_param: whatever
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
fail_on_missing_params:
|
|
|
|
- needed_param
|
|
|
|
register: argspec_fail_on_missing_params_bad
|
|
|
|
ignore_errors: true
|
|
|
|
|
2020-10-05 23:02:11 +02:00
|
|
|
- argspec:
|
|
|
|
required_together_one: foo
|
|
|
|
required_together_two: bar
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_together_one: foo
|
|
|
|
register: argspec_fail_required_together
|
|
|
|
ignore_errors: true
|
|
|
|
|
2020-10-06 20:15:02 +02:00
|
|
|
- argspec:
|
|
|
|
suboptions_list_no_elements:
|
|
|
|
- thing: foo
|
|
|
|
register: argspec_suboptions_list_no_elements
|
|
|
|
|
2020-09-22 17:33:59 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- argspec_required_if_fail is failed
|
2020-09-30 22:38:12 +02:00
|
|
|
|
2020-09-22 17:33:59 +02:00
|
|
|
- argspec_mutually_exclusive_fail is failed
|
2020-09-30 22:38:12 +02:00
|
|
|
|
2020-09-30 15:56:27 +02:00
|
|
|
- argspec_good_mapping is successful
|
|
|
|
- >-
|
|
|
|
argspec_good_mapping.mapping == {'foo': 'bar'}
|
|
|
|
- argspec_good_mapping_json is successful
|
|
|
|
- >-
|
|
|
|
argspec_good_mapping_json.mapping == {'foo': 'bar'}
|
|
|
|
- argspec_good_mapping_kv is successful
|
|
|
|
- >-
|
|
|
|
argspec_good_mapping_kv.mapping == {'foo': 'bar'}
|
|
|
|
- argspec_bad_mapping_string is failed
|
|
|
|
- argspec_bad_mapping_int is failed
|
|
|
|
- argspec_bad_mapping_list is failed
|
2020-09-30 22:38:12 +02:00
|
|
|
|
|
|
|
- argspec_required_together_fail is failed
|
|
|
|
|
|
|
|
- argpsec_required_if_fail is failed
|
2020-10-02 21:53:09 +02:00
|
|
|
|
|
|
|
- argspec_good_json_string is successful
|
2020-10-06 20:15:02 +02:00
|
|
|
- >-
|
2020-10-02 21:53:09 +02:00
|
|
|
argspec_good_json_string.json == '{"foo": "bar"}'
|
|
|
|
- argspec_good_json_dict is successful
|
2020-10-06 20:15:02 +02:00
|
|
|
- >-
|
2020-10-02 21:53:09 +02:00
|
|
|
argspec_good_json_dict.json == '{"foo": "bar"}'
|
|
|
|
- argspec_bad_json is failed
|
|
|
|
|
|
|
|
- argspec_fail_on_missing_params_bad is failed
|
2020-10-05 23:02:11 +02:00
|
|
|
|
|
|
|
- argspec_fail_required_together is failed
|
2020-10-06 20:15:02 +02:00
|
|
|
|
|
|
|
- >-
|
|
|
|
argspec_suboptions_list_no_elements.suboptions_list_no_elements.0 == {'thing': 'foo'}
|