Provisioning with external shell scripts

While inline scripts can be a useful tool to execute larger command blocks, some provisioning operations are so large and/or complex that it can be useful to create and maintain them separately from the Vagrantfile itself. Maintaining these scripts separately can also make maintaining provisioning scripts and Vagrantfiles much simpler.

Getting ready

In this recipe, we'll modify the nginx-install script, which was created in the previous recipe. In that example, a provisioning script was defined within a Ruby variable: a string embedded within the Vagrantfile itself. When provisioning scripts begin growing to involve multiple steps or different logic, it can be difficult to create and modify scripts within ...

Get Vagrant Virtual Development Environment Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.