Previously we set up an Nginx for the cat-pictures.com
site, and created a virtual host template so we could create many websites that differ only in a couple of parameters. Let's extend that a little further, and create a definition that includes everything required for an Nginx website.
Following the success of cat-pictures.com
and its sister site dog-pictures.com
, the creative department is building a new site where users can upload cute pictures of all kinds of animals. Your job is to use Puppet to set up a server for the new adorable-animals.com
site.
In your Puppet repo, create the file
modules/nginx/manifests/website.pp
with the following contents:# Manage an Nginx virtual host define nginx::website( $site_domain ) { include nginx $site_name = $name file { "/etc/nginx/sites-enabled/${site_name}.conf": content => template('nginx/vhost.conf.erb'), notify => Service['nginx'], } }
Modify your
manifests/nodes...