summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp69
1 files changed, 38 insertions, 31 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index d2bafc6..a5c8861 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -135,39 +135,46 @@ class nginx inherits nginx::base {
class nginx::puppetmaster inherits nginx::base {
- define proxy($name = $domain, $worker_processes = 4,
- $worker_connections = 1024,
- $ssl_port = 8140, $non_ssl_port = 8141,
- $puppetmaster_servers = [ "127.0.0.1:18140" ]) {
-
- file { "/etc/nginx/conf.d/puppetmaster.conf":
- content => template("nginx/puppetmaster.conf.erb"),
- owner => "root",
- group => "root",
- mode => 0644,
- ensure => present,
- notify => Service["nginx"],
- }
+ $worker_processes = $puppetmaster_puppetmasters ? {
+ '' => 4,
+ default => $puppetmaster_puppetmasters,
+ }
- nginx::base::site { "puppetmaster":
- ensure => present,
- source => 'template',
- require => File['/etc/nginx/conf.d/puppetmaster.conf'],
- }
+ $worker_connections = 1024,
+ $ssl_port = 8140,
+ $non_ssl_port = 8141,
+ $puppetmaster_servers = [ "127.0.0.1:18140",
+ "127.0.0.1:18141",
+ "127.0.0.1:18142",
+ "127.0.0.1:18143" ],
- # We don't want nginx to listen at port 80
- nginx::base::site { "default":
- source => 'none',
- ensure => absent,
- }
+ file { "/etc/nginx/conf.d/puppetmaster.conf":
+ content => template("nginx/puppetmaster.conf.erb"),
+ owner => "root",
+ group => "root",
+ mode => 0644,
+ ensure => present,
+ notify => Service["nginx"],
+ }
- file { "/etc/nginx/nginx.conf":
- content => template("nginx/nginx.conf.erb"),
- owner => "root",
- group => "root",
- mode => 0644,
- ensure => present,
- notify => Service["nginx"],
- }
+ nginx::base::site { "puppetmaster":
+ ensure => present,
+ source => 'template',
+ require => File['/etc/nginx/conf.d/puppetmaster.conf'],
+ }
+
+ # We don't want nginx to listen at port 80
+ nginx::base::site { "default":
+ source => 'none',
+ ensure => absent,
+ }
+
+ file { "/etc/nginx/nginx.conf":
+ content => template("nginx/nginx.conf.erb"),
+ owner => "root",
+ group => "root",
+ mode => 0644,
+ ensure => present,
+ notify => Service["nginx"],
}
}