Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/nginx/manifests/init.pp

Issue 5728306397708288: Added definition for eyeo.com webserver (Closed)
Patch Set: Created Dec. 5, 2013, 9:32 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « manifests/webserver.pp ('k') | modules/web/files/sitescripts » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/nginx/manifests/init.pp
===================================================================
--- a/modules/nginx/manifests/init.pp
+++ b/modules/nginx/manifests/init.pp
@@ -46,26 +46,32 @@ class nginx (
require => Package['nginx']
}
file {'/etc/nginx/sites-available/default':
ensure => absent,
require => Package['nginx']
}
-# file {'/etc/nginx/sites-enabled/default':
-# ensure => absent,
-# }
-
- define hostconfig ($file = $title, $source, $enabled = false) {
- file {"/etc/nginx/sites-available/${file}":
- ensure => file,
- source => $source,
- require => Package['nginx'],
- notify => Service['nginx'],
+ define hostconfig ($file = $title, $source = undef, $content = undef, $enabled = false) {
+ if $content != undef {
+ file {"/etc/nginx/sites-available/${file}":
+ ensure => file,
+ content => $content,
+ require => Package['nginx'],
+ notify => Service['nginx'],
+ }
+ }
+ else {
+ file {"/etc/nginx/sites-available/${file}":
+ ensure => file,
+ source => $source,
+ require => Package['nginx'],
+ notify => Service['nginx'],
+ }
}
if $enabled == true {
file {"/etc/nginx/sites-enabled/${file}":
ensure => link,
require => File["/etc/nginx/sites-available/${file}"],
target => "/etc/nginx/sites-available/${file}",
notify => Service['nginx']
}
« no previous file with comments | « manifests/webserver.pp ('k') | modules/web/files/sitescripts » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld