ansible-playbook has a --start-at-task option which you could use with
--step to terminate it after it ran just that one task.

Alternatively, you can use --tags to run just specific sets of tasks.  If
your playbook is configured to be able to be easily rerunnable, running
previous steps won't cause any problems, but the above steps can save time.

--tags are preferred and easier to use in most cases, as you can say
"--tags provision" or "--tags config" or "--tags apache" to quickly select
groups of tasks, or even multiples with "--tags apache:redis" and so forth.

(I should also mention a useful but unrelated feature, when ansible
playbooks fail, they generate a retry file and output information about
this retry file at the end of the standard output about the playbook run.
Running ansible again with the suggested parameters will only talk to hosts
that have failed in the previous run, skipping hosts that were 100%
successful)



On Thu, Sep 4, 2014 at 8:47 PM, Kien Pham <kien.p...@sendgrid.com> wrote:

> Hi,
>
> Is it possible to re-run failed tasks?
>
> Ex: I have 10 tasks, task #9 failed. The next time I run, I only want to
> run task #9 only.
>
> This is very helpful for development of the playbook. Do you know if we
> can do this already?
>
> Thanks,
> Kien
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/cabd28b6-a003-47f8-a8aa-fe2777480fe2%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/cabd28b6-a003-47f8-a8aa-fe2777480fe2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxeEg4o15ChkO0GJk5XnGrXySmxmUkT0NgiReOAQ4aSFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to