script
module takes the script name followed by a list of space-delimited arguments.parameter | required | default | choices | comments |
---|---|---|---|---|
chdir (added in 2.4)
| no | cd into this directory on the remote node before running the script | ||
creates (added in 1.5)
| no | a filename, when it already exists, this step will not be run. | ||
decrypt (added in 2.4)
| no | Yes |
| This option controls the autodecryption of source files using vault. |
free_form | yes | 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)
| no | a filename, when it does not exist, this step will not be run. |
# 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
Note
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 this support of this module, please refer to this knowledge base article<https://access.redhat.com/articles/rhel-top-support-policies>
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/script_module.html