Skip to content

Commit d8c947f

Browse files
author
Tim Meusel
committed
added basix nginx conf
1 parent 572a132 commit d8c947f

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

manifests/master.pp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# ['puppetdb_startup_timeout'] - The timeout for puppetdb
3333
# ['dns_alt_names'] - Comma separated list of alternative DNS names
3434
# ['digest_algorithm'] - The algorithm to use for file digests.
35-
# ['webserver'] - no webserver if undef, otherwise httpd
35+
# ['webserver'] - install 'nginx' (with unicorn) or 'httpd' (with passanger)
3636
#
3737
# Requires:
3838
#
@@ -84,7 +84,7 @@
8484
$puppetdb_strict_validation = $::puppet::params::puppetdb_strict_validation,
8585
$dns_alt_names = ['puppet'],
8686
$digest_algorithm = $::puppet::params::digest_algorithm,
87-
$webserver = undef,
87+
$webserver = 'httpd',
8888
) inherits puppet::params {
8989

9090
anchor { 'puppet::master::begin': }
@@ -120,8 +120,9 @@
120120
ensure => $version,
121121
}
122122
}
123-
if $webserver != undef {
124-
Anchor['puppet::master::begin'] ->
123+
case $webserver {
124+
httpd: {
125+
Anchor['puppet::master::begin'] ->
125126
class {'puppet::passenger':
126127
puppet_passenger_port => $puppet_passenger_port,
127128
puppet_docroot => $puppet_docroot,
@@ -132,7 +133,11 @@
132133
conf_dir => $::puppet::params::confdir,
133134
dns_alt_names => join($dns_alt_names,','),
134135
} ->
135-
Anchor['puppet::master::end']
136+
Anchor['puppet::master::end']
137+
}
138+
nginx: {
139+
Anchor['puppet::master::begin'] ->
140+
class {'puppet::unicorn':}
136141
}
137142
service { $puppet_master_service:
138143
ensure => stopped,
@@ -147,11 +152,7 @@
147152
require => File[$::puppet::params::confdir],
148153
owner => $::puppet::params::puppet_user,
149154
group => $::puppet::params::puppet_group,
150-
}
151-
if $webserver != undef {
152-
file { $::puppet::params::puppet_conf:
153-
notify => Service['httpd'],
154-
}
155+
notify => Service[$webserver],
155156
}
156157
}
157158
else {

manifests/unicorn.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# this class installs nginx with unicorn infront of puppetmaster
2+
class puppet:unicorn () {
3+
include nginx
4+
# nginx::resource::vhost {'puppetmaster':
5+
# www_root => '/var/empty',
6+
# }
7+
}

0 commit comments

Comments
 (0)