Is it possible to catch non-zero exit codes from my shell provisioner instead of exiting the provisioner immediately?

7 views
Skip to first unread message

Niko

unread,
Feb 20, 2018, 9:40:28 AM2/20/18
to Vagrant
I want my provisioner to catch certain return codes from my provisioning script, but unfortunately Vagrant processes any non-zero codes as an "error" (which is not the case). Is there any way to handle the exception and continue instead?

Yves Guerin

unread,
Feb 22, 2018, 9:07:24 AM2/22/18
to Vagrant
Dear,

I run this:

Vagrantfile
  - shell exec ./provisioner/bootstrap.sh
    -- ./provisioner/bootstrap.sh exec ../modules/install.sh
    my bootstrap.sh trap the error code from ../modules/install.sh so I am able to decide what to do after.
Reply all
Reply to author
Forward
0 new messages