The command/shell modules already do this with the creates/removes options.
See the documentation here:

http://docs.ansible.com/command_module.html



On Fri, May 2, 2014 at 1:24 AM, Andrew Pashkin <[email protected]>wrote:

> What is the good way to make command run only one time and never run it
> again if once it succeeds?
> I think it might be done by triggering a handler which creates a flag-file
> after command succeds and also by defining a condition which prevents
> command run if that flag-file exists.
> But how to accomplish that? The problems that I can't solve here is:
> 1) How to trigger a handler only if command succeeds?
> 2) How to run commands only if certain file exists?
>
> --
> С наилучшими пожеланиями, Андрей Пашкин.
> м.т - +7 (985) 898 57 59
> Skype - waves_in_fluids
> e-mail - [email protected]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/53633A2D.5040007%40gmx.co.uk.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAMFyvFg1v_Dr07uGt77gLR4HMB4sypyO%3DSjjzK03AJB-jV%2BHhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to