diff options
author | jeromew <jerome.wagner@m4x.org> | 2014-01-17 08:14:25 +0000 |
---|---|---|
committer | jeromew <jerome.wagner@m4x.org> | 2014-02-18 12:52:09 +0000 |
commit | 2fcce7e22523dde37c551480b408391d578986aa (patch) | |
tree | 8e9a100176751d83e137dd4b1cc417e12f8c2482 /commands | |
parent | a6d92bf4b72645baa2523fb2e83f953938d1a8b8 (diff) | |
download | ansible-modules-extras-2fcce7e22523dde37c551480b408391d578986aa.tar.gz |
Add creates= and removes= to the script: action
Diffstat (limited to 'commands')
-rw-r--r-- | commands/script | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/commands/script b/commands/script index 143b2b25..276d16c4 100644 --- a/commands/script +++ b/commands/script @@ -18,6 +18,18 @@ options: required: true default: null aliases: [] + creates: + description: + - a filename, when it already exists, this step will B(not) be run. + required: no + default: null + version_added: "1.5" + removes: + description: + - a filename, when it does not exist, this step will B(not) be run. + required: no + default: null + version_added: "1.5" notes: - It is usually preferable to write Ansible modules than pushing scripts. Convert your script to an Ansible module for bonus points! author: Michael DeHaan @@ -26,4 +38,10 @@ author: Michael DeHaan EXAMPLES = ''' # 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 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 removes=/the/removed/file.txt ''' |