puppet: Properly configure nginx service and disable default site.

(imported from commit 4c526c9333445e2575a85d1e90ccc134717f19f6)
This commit is contained in:
Tim Abbott 2013-06-12 16:43:16 -04:00
parent f0f8ce957a
commit 19d8cfd657
2 changed files with 28 additions and 9 deletions

View File

@ -1,8 +1,9 @@
class humbug::app_frontend {
class { 'humbug::base': }
class { 'humbug::rabbit': }
class { 'humbug::nginx': }
$web_packages = [ "nginx", "memcached", "python-pylibmc", "python-tornado", "python-django",
$web_packages = [ "memcached", "python-pylibmc", "python-tornado", "python-django",
"python-pygments", "python-flup", "ipython", "python-psycopg2",
"yui-compressor", "python-django-auth-openid",
"python-django-statsd-mozilla",
@ -17,14 +18,6 @@ class humbug::app_frontend {
"python-diff-match-patch",]
package { $web_packages: ensure => "installed" }
file { "/etc/nginx/nginx.conf":
require => Package[nginx],
ensure => file,
owner => "root",
group => "root",
mode => 644,
source => "puppet:///modules/humbug/nginx/nginx.conf",
}
file { "/etc/nginx/humbug-include/":
require => Package[nginx],
recurse => true,
@ -32,6 +25,7 @@ class humbug::app_frontend {
group => "root",
mode => 644,
source => "puppet:///modules/humbug/nginx/humbug-include/",
notify => Service["nginx"],
}
file { "/etc/memcached.conf":
require => Package[memcached],

View File

@ -0,0 +1,25 @@
# For any system using nginx (currently just app frontends)
class humbug::nginx {
$web_packages = [ "nginx", ]
package { $web_packages: ensure => "installed" }
file { "/etc/nginx/nginx.conf":
require => Package[nginx],
ensure => file,
owner => "root",
group => "root",
mode => 644,
source => "puppet:///modules/humbug/nginx/nginx.conf",
}
file { "/etc/nginx/sites-enabled/default":
notify => Service["nginx"],
ensure => absent,
}
service { 'nginx':
ensure => running,
subscribe => File['/etc/nginx/nginx.conf'],
}
}