script
module takes the script name followed by a list of space-delimited arguments.Parameter | Choices/Defaults | Comments |
---|---|---|
chdir
(added in 2.4) |
cd into this directory on the remote node before running the script
|
|
creates
(added in 1.5) |
a filename, when it already exists, this step will not be run.
|
|
decrypt
bool (added in 2.4) |
Yes
|
This option controls the autodecryption of source files using vault.
|
executable
(added in 2.6) |
Name or path of a executable to invoke the script with
|
|
free_form
required |
Path to the local script file followed by optional arguments. There is no parameter actually named 'free form'; see the examples!
|
|
removes
(added in 1.5) |
a filename, when it does not exist, this step will not be run.
|
Note
# Example from Ansible Playbooks
- script: /some/local/script.sh --some-arguments 1234
# Run a script that creates a file, but only if the file is not yet created
- script: /some/local/create_file.sh --some-arguments 1234
args:
creates: /the/created/file.txt
# Run a script that removes a file, but only if the file is not yet removed
- script: /some/local/remove_file.sh --some-arguments 1234
args:
removes: /the/removed/file.txt
# Run a script using a executable in a non-system path
- script: /some/local/script
args:
executable: /some/remote/executable
# Run a script using a executable in a system path
- script: /some/local/script.py
args:
executable: python3
This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.
For more information about Red Hat’s support of this module, please refer to this Knowledge Base article
Hint
If you notice any issues in this documentation you can edit this document to improve it.