I understand, but i think will be easier in the other way around.

The scripts you create should be idempotent, that is, sense they are
already executed, or skip running twice for any check you do.

when you provision, if one script fail, my impression is the provision will
fail, and the err will be displayed on the screen on a nice red color.

There is nothing wrong with this approach, as you can just 'vagrant
provision' a 2nd time, and the script(s) should be smart enough to sense
witch ones/parts did run and skip them.

I deploy multi node oracle rac clusters, and I need all the scripts to be
run at least once, but in case of error, I would like to avoid a partition
be blown away, or the 2nd disk to be formatted again, etc..

Then later on my test case, I add a 3rd or 4th node, and I can safely run
vagrant up / vagrant provision and will just do the new nodes.

this require a little bit more effor on the script, but later it pays
pretty soon.



On Tue, Aug 19, 2014 at 2:35 AM, Harish Patel <[email protected]>
wrote:

> I would rather have the code in the VagrantFile so I do not have to
> duplicate across shell files.
>
> On Friday, August 15, 2014 7:21:20 PM UTC-4, Alvaro Miranda Aguilera wrote:
>>
>> can those messages in case of errors be on the script?
>>
>>
>>
>> On Sat, Aug 16, 2014 at 8:26 AM, Harish Patel <[email protected]>
>> wrote:
>>
>>> Tried something like before but the 'puts' statement is only run at the
>>> very beggining of 'vagrant up', not when the actual provisioner is run.  In
>>> this case, I want to print a message so the user knows that the shell file
>>> failed.
>>>
>>> config.vm.provision "shell" do |s|
>>>     begin
>>>       s.path = "#{SCRIPTS}/#{CONFIGURE_SETTINGS}"
>>>       s.args = "#{USER} #{PW}"
>>>     rescue
>>>       puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!AN ERROR
>>> REACHED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
>>>     end
>>>   end
>>>
>>> --
>>> 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].
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> 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].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to