Book Image

Vagrant Virtual Development Environment Cookbook

Book Image

Vagrant Virtual Development Environment Cookbook

Overview of this book

Table of Contents (17 chapters)
Vagrant Virtual Development Environment Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 a Vagrantfile. In most cases, we will want to remove the scripting from the Vagrantfile and instead execute provisioning from standalone scripts.

Before we create new provisioning scripts, let's recreate our html directory configuration of the previous...