Things are looking up at cat-pictures.com
headquarters. They've just got VC funding to build three new sites: dog-pictures.com
, hamster-pictures.com
, and fish-pictures.com
. To prepare for this, your job is to change the Puppet config for cat-pictures.com
to use a template, so that you can later use the same template for the new sites.
Modify the
modules/nginx/manifests/init.pp
file as follows:# Manage nginx webserver class nginx { package { 'nginx': ensure => installed, } service { 'nginx': ensure => running, enable => true, require => Package['nginx'], } file { '/etc/nginx/sites-enabled/default': ensure => absent, } }
Create a new
templates
directory in thenginx
module:ubuntu@demo:~/puppet$ mkdir modules/nginx/templates
Create the file
modules/nginx/templates/vhost.conf.erb
with the following contents:server { listen 80; root /var/www/<%= @site_name %>; server_name <%= @site_domain...