Question:
After I provision my Vagrant… I may get errors during provision… how do I restart from error, instead of doing everything from scratch ?
1 2 |
vagrant destroy -f && vagrant up |
And I may get an error…
1 2 3 |
PLAY RECAP ******************************************************************** to retry, use: --limit @/path/to/playbook.retry |
And I want to just resume from where it failed… it seems it can be done by the message… use --limit
…. but when I use it in the vagrant context it doesn’t work..
Answer:
You can edit the Vagrantfile
and include the ansible.start_at_task variable.
Then you can re-run the provision with $ vagrant reload --provision
Vagrant Reload docs
However, because Ansible plays are idempotent you don’t really need to do the start_at_task
. You can just re-run the provision with the reload command above.