Hi Dan, You are correct that you cannot receive the exit code of a provision task from within the Vagrantfile. Vagrant provisioners do not currently support retries on failure. One option is to re-run a vagrant provision on the failed node, and then vagrant up again. The other would be identifying the common failure points of the provision task and make it more robust to gracefully handle errors with automatic retries.
That said, provision retries is an enhancement that I'm interested in implementing and hope to tackle soon. If you have other questions or more input/ideas around the provision retry stuff, just let me know. Cheers! - Chris On Thu, Aug 18, 2016 at 1:38 PM, <[email protected]> wrote: > While I appreciate the suggestion for a workaround, I think Vagrant can do > better. > > Maybe this is more a question regarding the level of responsibility > Vagrant has over the actions it performs. > > - Should Vagrant offer the ability to get the exit code of > a provisioner? > - With that info, should Vagrant allow the developer to perform > different actions based on the returned value? > - Specifically for the Puppet provisioners: > - Should Vagrant allow the developer to configure a set number of > retries when a non-zero exit code is returned. > > This has come up because we use Vagrant to provision multi-node > environments, and when a single provisioner in one node fails, the whole > process is halted. This results in re-running the whole process again, > which can cost us a lot of time in some cases. > > I wanted to start discussion about this here before creating an issue > (just in case this feature was already supported, and I just missed it). > > I'm all ears on any other suggestions for our use-case, but I may bring > this up in an issue soon to continue discussion there (and possibly create > a PR). > > On Sunday, August 14, 2016 at 2:11:18 AM UTC-7, Alvaro Miranda Aguilera > wrote: >> >> Yup. >> >> You can a shell provisioner, and implement there a counter and run puppet. >> That was I trying to explain. >> >> Alvaro. >> >> On Sat, Aug 13, 2016 at 8:23 PM, Edward Evans <[email protected]> wrote: >> >>> The provisioner section using the shell plugin will run the bash script >>> above during the provision step. >>> >>> -- >>> This mailing list is governed under the HashiCorp Community Guidelines - >>> https://www.hashicorp.com/community-guidelines.html. Behavior in >>> violation of those guidelines may result in your removal from this mailing >>> list. >>> >>> GitHub Issues: https://github.com/mitchellh/vagrant/issues >>> IRC: #vagrant on Freenode >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Vagrant" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/vagrant-up/56468d50-3199-43f2-b910-cd65eebd1348%40googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Alvaro >> (+31)103400555 >> > -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/mitchellh/vagrant/issues > IRC: #vagrant on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Vagrant" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/vagrant-up/bdaeaa17-b720-4be8-a530-b21168727a88%40googlegroups.com > <https://groups.google.com/d/msgid/vagrant-up/bdaeaa17-b720-4be8-a530-b21168727a88%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/vagrant/issues IRC: #vagrant on Freenode --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CANhAuoAdq-h8w5nJkQYkrKx5sAd%3Dc%2BNNZY8ZC73o2ui92znApQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
