mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 20:13:59 -07:00
* Fixes #19392: allow commands to be specified as lists. new syntax is documented as well
This commit is contained in:
parent
b325e9900c
commit
223a4c0685
3 changed files with 61 additions and 5 deletions
|
@ -79,6 +79,35 @@
|
|||
- "no_command.msg == 'no command given'"
|
||||
- "no_command.rc == 256"
|
||||
|
||||
- name: use argv
|
||||
command:
|
||||
argv:
|
||||
- echo
|
||||
- testing
|
||||
register: argv_command
|
||||
ignore_errors: true
|
||||
|
||||
- name: assert executable works with argv
|
||||
assert:
|
||||
that:
|
||||
- "argv_command.stdout == 'testing'"
|
||||
|
||||
- name: use argv and command string
|
||||
command: echo testing
|
||||
args:
|
||||
argv:
|
||||
- echo
|
||||
- testing
|
||||
register: argv_and_string_command
|
||||
ignore_errors: true
|
||||
|
||||
- name: assert executable fails with both argv and command string
|
||||
assert:
|
||||
that:
|
||||
- "argv_and_string_command.failed == true"
|
||||
- "argv_and_string_command.msg == 'only command or argv can be given, not both'"
|
||||
- "argv_and_string_command.rc == 256"
|
||||
|
||||
- set_fact: output_dir_test={{output_dir}}/test_command_shell
|
||||
|
||||
- name: make sure our testing sub-directory does not exist
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue