From 07806df3d3257e36013d15825d2237eaec1e7235 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 15 Feb 2011 17:16:16 -0200 Subject: Managing default site and nginx.conf --- manifests/init.pp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'manifests/init.pp') diff --git a/manifests/init.pp b/manifests/init.pp index 4972730..2e66f78 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -90,6 +90,16 @@ class nginx::base { notify => Service["nginx"], } } + + # Main configuration + file { "/etc/nginx/nginx.conf": + content => template("nginx/nginx.conf.erb"), + owner => "root", + group => "root", + mode => 0644, + ensure => present, + notify => Service["nginx"], + } } class nginx inherits nginx::base { @@ -107,8 +117,13 @@ class nginx inherits nginx::base { } # Default site - nginx::base::site { "$domain": ensure => present, } + nginx::base::site { "default": + ensure => present, + source => 'template', + } + # Domain site + nginx::base::site { "$domain": ensure => present, } } class nginx::puppetmaster inherits nginx::base { @@ -147,12 +162,7 @@ class nginx::puppetmaster inherits nginx::base { ensure => absent, } - file { "/etc/nginx/nginx.conf": - content => template("nginx/nginx.conf.erb"), - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Service["nginx"], + File["/etc/nginx/nginx.conf"] { + content => template("nginx/nginx.conf.puppetmaster.erb"), } } -- cgit v1.2.3