Skip to content

Commit

Permalink
Add rails app and setup nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
he9lin committed Mar 16, 2012
1 parent 97927c8 commit 369311f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
28 changes: 27 additions & 1 deletion manifests/nodes.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
node 'app' {
include mongodb
include nginx
# include redis
# include mongodb
include railsapp

nginx::resource::upstream { 'thin':
ensure => present,
members => [
'localhost:3000',
],
}
nginx::resource::upstream { 'faye':
ensure => present,
members => [
'localhost:9292',
],
}
nginx::resource::vhost { 'jieqoo.com':
ensure => present,
www_root => '/var/www/jieqoo.com',
listen_port => '80',
}
nginx::resource::location { 'jieqoo.com-faye':
ensure => present,
proxy => 'http://faye',
location => '/faye',
vhost => 'jieqoo.com',
}
}
11 changes: 11 additions & 0 deletions modules/railsapp/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class railsapp {
file {
["/var/www/jieqoo.com/",
"/var/www/jieqoo.com/shared/",
"/var/www/jieqoo.com/shared/config/"]:
ensure => directory,
owner => vagrant,
group => vagrant,
mode => 775
}
}

0 comments on commit 369311f

Please sign in to comment.