2020-10-22 21:05:59 +02:00
|
|
|
- argspec:
|
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_one_of_one: value
|
|
|
|
register: argspec_required_fail
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required: value
|
|
|
|
required_one_of_two: value
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required: value
|
|
|
|
register: argspec_required_one_of_fail
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required: value
|
|
|
|
required_one_of_two: value
|
|
|
|
required_by_one: value
|
|
|
|
required_by_two: value
|
|
|
|
required_by_three: value
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required: value
|
|
|
|
required_one_of_two: value
|
|
|
|
required_by_one: value
|
|
|
|
required_by_two: value
|
|
|
|
register: argspec_required_by_fail
|
|
|
|
ignore_errors: true
|
|
|
|
|
2020-09-22 17:33:59 +02:00
|
|
|
- argspec:
|
|
|
|
state: absent
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-22 17:33:59 +02:00
|
|
|
|
|
|
|
- argspec:
|
|
|
|
state: present
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-22 17:33:59 +02:00
|
|
|
register: argspec_required_if_fail
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
state: present
|
|
|
|
path: foo
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-22 17:33:59 +02:00
|
|
|
|
|
|
|
- argspec:
|
|
|
|
state: present
|
|
|
|
content: foo
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-22 17:33:59 +02:00
|
|
|
|
|
|
|
- argspec:
|
|
|
|
state: present
|
|
|
|
content: foo
|
|
|
|
path: foo
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-22 17:33:59 +02:00
|
|
|
register: argspec_mutually_exclusive_fail
|
|
|
|
ignore_errors: true
|
|
|
|
|
2020-09-30 15:56:27 +02:00
|
|
|
- argspec:
|
|
|
|
mapping:
|
|
|
|
foo: bar
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 15:56:27 +02:00
|
|
|
register: argspec_good_mapping
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
mapping: foo=bar
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 15:56:27 +02:00
|
|
|
register: argspec_good_mapping_kv
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
mapping: !!str '{"foo": "bar"}'
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 15:56:27 +02:00
|
|
|
register: argspec_good_mapping_json
|
|
|
|
|
2020-11-04 16:46:08 +01:00
|
|
|
- argspec:
|
|
|
|
mapping: !!str '{"foo": False}'
|
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
|
|
|
register: argspec_good_mapping_dict_repr
|
|
|
|
|
2020-09-30 15:56:27 +02:00
|
|
|
- argspec:
|
|
|
|
mapping: foo
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 15:56:27 +02:00
|
|
|
register: argspec_bad_mapping_string
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
mapping: 1
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 15:56:27 +02:00
|
|
|
register: argspec_bad_mapping_int
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
mapping:
|
|
|
|
- foo
|
|
|
|
- bar
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 15:56:27 +02:00
|
|
|
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
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 22:38:12 +02:00
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_together:
|
|
|
|
- another: baz
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 22:38:12 +02:00
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_together:
|
|
|
|
- thing: foo
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 22:38:12 +02:00
|
|
|
register: argspec_required_together_fail
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_together:
|
|
|
|
- thing: foo
|
|
|
|
other: bar
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 22:38:12 +02:00
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_if:
|
|
|
|
- thing: bar
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 22:38:12 +02:00
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_if:
|
|
|
|
- thing: foo
|
|
|
|
other: bar
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-09-30 22:38:12 +02:00
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_if:
|
|
|
|
- thing: foo
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
|
|
|
register: argspec_required_if_fail_2
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_one_of:
|
|
|
|
- thing: foo
|
|
|
|
other: bar
|
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_one_of:
|
|
|
|
- {}
|
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
|
|
|
register: argspec_required_one_of_fail_2
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_by:
|
|
|
|
- thing: foo
|
|
|
|
other: bar
|
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_by:
|
|
|
|
- thing: foo
|
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
|
|
|
register: argspec_required_by_fail_2
|
2020-09-30 22:38:12 +02:00
|
|
|
ignore_errors: true
|
|
|
|
|
2020-10-02 21:53:09 +02:00
|
|
|
- argspec:
|
|
|
|
json: !!str '{"foo": "bar"}'
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-10-02 21:53:09 +02:00
|
|
|
register: argspec_good_json_string
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
json:
|
|
|
|
foo: bar
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-10-02 21:53:09 +02:00
|
|
|
register: argspec_good_json_dict
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
json: 1
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-10-02 21:53:09 +02:00
|
|
|
register: argspec_bad_json
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
fail_on_missing_params:
|
|
|
|
- needed_param
|
|
|
|
needed_param: whatever
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-10-02 21:53:09 +02:00
|
|
|
|
|
|
|
- argspec:
|
|
|
|
fail_on_missing_params:
|
|
|
|
- needed_param
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-10-02 21:53:09 +02:00
|
|
|
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
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-10-05 23:02:11 +02:00
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required_together_one: foo
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
|
|
|
register: argspec_fail_required_together_2
|
2020-10-05 23:02:11 +02:00
|
|
|
ignore_errors: true
|
|
|
|
|
2020-10-06 20:15:02 +02:00
|
|
|
- argspec:
|
|
|
|
suboptions_list_no_elements:
|
|
|
|
- thing: foo
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-10-06 20:15:02 +02:00
|
|
|
register: argspec_suboptions_list_no_elements
|
|
|
|
|
2020-10-06 23:00:28 +02:00
|
|
|
- argspec:
|
|
|
|
choices_with_strings_like_bools: on
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-10-06 23:00:28 +02:00
|
|
|
register: argspec_choices_with_strings_like_bools_true
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
choices_with_strings_like_bools: 'on'
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-10-06 23:00:28 +02:00
|
|
|
register: argspec_choices_with_strings_like_bools_true_bool
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
choices_with_strings_like_bools: off
|
2020-10-22 21:05:59 +02:00
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
2020-10-06 23:00:28 +02:00
|
|
|
register: argspec_choices_with_strings_like_bools_false
|
|
|
|
|
2020-11-02 17:35:13 +01:00
|
|
|
- argspec:
|
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
|
|
|
choices: foo
|
|
|
|
|
|
|
|
- argspec:
|
|
|
|
required: value
|
|
|
|
required_one_of_one: value
|
|
|
|
choices: baz
|
|
|
|
register: argspec_choices_bad_choice
|
|
|
|
ignore_errors: true
|
|
|
|
|
2020-09-22 17:33:59 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
2020-10-22 21:05:59 +02:00
|
|
|
- argspec_required_fail is failed
|
|
|
|
|
|
|
|
- argspec_required_one_of_fail is failed
|
|
|
|
|
|
|
|
- argspec_required_by_fail is failed
|
|
|
|
|
2020-09-22 17:33:59 +02:00
|
|
|
- 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'}
|
2020-11-04 16:46:08 +01:00
|
|
|
- argspec_good_mapping_dict_repr is successful
|
|
|
|
- >-
|
|
|
|
argspec_good_mapping_dict_repr.mapping == {'foo': False}
|
2020-09-30 15:56:27 +02:00
|
|
|
- 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
|
|
|
|
|
2020-10-22 21:05:59 +02:00
|
|
|
- argspec_required_if_fail_2 is failed
|
|
|
|
|
|
|
|
- argspec_required_one_of_fail_2 is failed
|
|
|
|
|
|
|
|
- argspec_required_by_fail_2 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
|
|
|
|
2020-10-22 21:05:59 +02:00
|
|
|
- argspec_fail_required_together_2 is failed
|
2020-10-06 20:15:02 +02:00
|
|
|
|
|
|
|
- >-
|
|
|
|
argspec_suboptions_list_no_elements.suboptions_list_no_elements.0 == {'thing': 'foo'}
|
2020-10-06 23:00:28 +02:00
|
|
|
|
|
|
|
- argspec_choices_with_strings_like_bools_true.choices_with_strings_like_bools == 'on'
|
|
|
|
- argspec_choices_with_strings_like_bools_true_bool.choices_with_strings_like_bools == 'on'
|
2020-11-02 17:35:13 +01:00
|
|
|
- argspec_choices_with_strings_like_bools_false.choices_with_strings_like_bools == 'off'
|
|
|
|
|
|
|
|
- argspec_choices_bad_choice is failed
|