Creating the Puppet manifests
Let's start by creating some folders for our Puppet modules and manifests by executing the following commands:
mkdir provision cd provision mkdir modules mkdir manifests
For each of the modules we want to create, we need to create a folder within the provision/modules
folder for the module. Within this folder, we need to create a manifests
folder, and within this, our Puppet manifest file, init.pp
. Structurally, this looks something like the following:
|-- provision | |-- manifests | | `-- vagrant.pp | `-- modules | |-- our module | |-- manifests | `-- init.pp `-- Vagrantfile
Installing Nginx
Let's take a look at what is involved to install Nginx through a module and manifest file provision/modules/nginx/manifests/init.pp
. First, we define our class, passing in a variable so that we can change the configuration file we use for Nginx (useful for using the same module for different projects or different environments...