mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
Ensure action plugins accept only valid args (#44779)
* Ensure action plugins accept only valid args This fixes #25424 This also fixes #44773 * Add missing parameters, use private _VALID_ARGS
This commit is contained in:
parent
33e9d67801
commit
bf9ed0263a
15 changed files with 61 additions and 13 deletions
|
@ -34,13 +34,25 @@
|
|||
command: who -b
|
||||
register: after_boot_time
|
||||
|
||||
- name: Enusure system was actually rebooted
|
||||
- name: Ensure system was actually rebooted
|
||||
assert:
|
||||
that:
|
||||
- reboot_result is changed
|
||||
- reboot_result.elapsed > 10
|
||||
- before_boot_time.stdout != after_boot_time.stdout
|
||||
|
||||
- name: Use invalid parameter
|
||||
reboot:
|
||||
foo: bar
|
||||
ignore_errors: yes
|
||||
register: invalid_parameter
|
||||
|
||||
- name: Ensure task fails with error
|
||||
assert:
|
||||
that:
|
||||
- invalid_parameter is failed
|
||||
- "invalid_parameter.msg == 'Invalid options for reboot: foo'"
|
||||
|
||||
always:
|
||||
- name: Cleanup temp file
|
||||
file:
|
||||
|
|
|
@ -3,3 +3,15 @@
|
|||
connect_timeout: 5
|
||||
sleep: 1
|
||||
timeout: 10
|
||||
|
||||
- name: Use invalid parameter
|
||||
wait_for_connection:
|
||||
foo: bar
|
||||
ignore_errors: yes
|
||||
register: invalid_parameter
|
||||
|
||||
- name: Ensure task fails with error
|
||||
assert:
|
||||
that:
|
||||
- invalid_parameter is failed
|
||||
- "invalid_parameter.msg == 'Invalid options for wait_for_connection: foo'"
|
||||
|
|
|
@ -76,3 +76,15 @@
|
|||
win_user:
|
||||
name: '{{standard_user}}'
|
||||
state: absent
|
||||
|
||||
- name: Use invalid parameter
|
||||
reboot:
|
||||
foo: bar
|
||||
ignore_errors: yes
|
||||
register: invalid_parameter
|
||||
|
||||
- name: Ensure task fails with error
|
||||
assert:
|
||||
that:
|
||||
- invalid_parameter is failed
|
||||
- "invalid_parameter.msg == 'Invalid options for reboot: foo'"
|
||||
|
|
|
@ -171,7 +171,6 @@
|
|||
- "'RPM-GPG2-KEY-EPEL' in repofile"
|
||||
- "'aaa bbb' in repofile"
|
||||
- "'ccc ddd' in repofile"
|
||||
value:
|
||||
|
||||
- name: Cleanup list test repo
|
||||
yum_repository:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue