mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add note to use script module rather than inline here documents (#32863)
* Add example on how to use a here document with shell module * Remove here doc example and add note to use script module instead
This commit is contained in:
parent
710db04ebd
commit
5e7ee9df0a
1 changed files with 10 additions and 8 deletions
|
@ -67,14 +67,16 @@ options:
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
notes:
|
notes:
|
||||||
- If you want to execute a command securely and predictably, it may be
|
- If you want to execute a command securely and predictably, it may be
|
||||||
better to use the M(command) module instead. Best practices when writing
|
better to use the M(command) module instead. Best practices when writing
|
||||||
playbooks will follow the trend of using M(command) unless the C(shell)
|
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
|
module is explicitly required. When running ad-hoc commands, use your best
|
||||||
judgement.
|
judgement.
|
||||||
- To sanitize any variables passed to the shell module, you should use
|
- 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.
|
"{{ 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.
|
- For Windows targets, use the M(win_shell) module instead.
|
||||||
|
- Rather than using here documents to create multi-line scripts inside playbooks,
|
||||||
|
use the M(script) module instead.
|
||||||
requirements: [ ]
|
requirements: [ ]
|
||||||
author:
|
author:
|
||||||
- Ansible Core Team
|
- Ansible Core Team
|
||||||
|
|
Loading…
Reference in a new issue