Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible: run a failed task

I'm writing a playbook. My workflow looks like this:

  • add a task or a few tasks
  • run playbook
  • if fails: change something and return to previous step

If the playbook is long enough it takes a lot of time rerun a playbook. Is there a way to run only the last(failed) task? or Can you propose the other way how to speed a process of playbook creation?

like image 206
kharandziuk Avatar asked Sep 22 '15 13:09

kharandziuk


1 Answers

You may use --start-at-task parameter of ansible-playbook

--start-at-task=START_AT
      start the playbook at the task matching this name

Another option is to use --step parameter that allows you to step through the playbook and decide what to run.

like image 55
Vor Avatar answered Oct 01 '22 20:10

Vor