mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Enable check_mode in command module (#40428)
* Enable check_mode in command module This only works if supplying creates or removes since it needs something to base the heuristic off. If none are supplied it will just skip as usual. Fixes #15828 * Add documentation for new check_mode behavior
This commit is contained in:
parent
7fedda4c1d
commit
460f858640
4 changed files with 24 additions and 3 deletions
|
@ -61,6 +61,10 @@ notes:
|
|||
playbooks will follow the trend of using M(command) unless the C(shell)
|
||||
module is explicitly required. When running ad-hoc commands, use your best
|
||||
judgement.
|
||||
- Check mode is supported when passing C(creates) or C(removes). If running
|
||||
in check mode and either of these are specified, the module will check for
|
||||
the existence of the file and report the correct changed status. If these
|
||||
are not supplied, the task will be skipped.
|
||||
- To sanitize any variables passed to the shell module, you should use
|
||||
"{{ var | quote }}" instead of just "{{ var }}" to make sure they don't include evil things like semicolons.
|
||||
- For Windows targets, use the M(win_shell) module instead.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue