Using Vagrant and Puppet to provision an Nginx AngularJS site

I made a simple example showing how to provision a Ubuntu 14.04 Nginx web server hosting a sample AngularJS application VM using Vagrant and Puppet.

Source here.

Using this to learn more about Puppet and as the frontend part of another example for Microservice Authentication and Authorisation.

Created and tested on Mac OSX 10.9.5, Vagrant 1.6.3, VirtualBox 4.3.6, otherwise using versions/boxes given in VagrantFile and Puppet config.


# Clone
git clone

# Get JS and CSS library resources (AngularJS and Bootstrap) for the site using npm and bower
# Starts up VM and runs puppet to setup, downloading box if necessary
vagrant up
# On completion nginx should be running and the AngularJS site accessible from host at


The AngularJS site lives in the site_content puppet module and can be run separately using npm and tested.

# run local

# test

# e2e protractor tests


Used jfryman-nginx v0.1.1 module to puppetize nginx, added using:

puppet module install jfryman-nginx  --modulepath puppet/modules

I created a custom puppet module site_content (puppet/modules/site_content) which ensures /var/www exists and deploys the AngularJS site.


This is a bare bones example and does not include any security or configuration best practise, so do not use in production.

Any change to the puppet files requires you to run ‘vagrant provision’ to update.

Possible improvements

  • Move the site content under src directory and build RPM with content instead of using explicit puppet module, that way site can be versioned and installed as RPM directly

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s