OLD | NEW |
1 class discourse inherits private::discourse { | 1 class discourse inherits private::discourse { |
2 include postgresql::server | 2 include postgresql::server |
3 | 3 |
4 postgresql::database {'discourse':} | 4 postgresql::database {'discourse':} |
5 | 5 |
6 postgresql::role {'discourse': | 6 postgresql::role {'discourse': |
7 password_hash => 'vagrant', | 7 password_hash => 'vagrant', |
8 db => 'discourse', | 8 db => 'discourse', |
9 login => true, | 9 login => true, |
10 superuser => true | 10 superuser => true |
(...skipping 15 matching lines...) Expand all Loading... |
26 require => Package['ruby1.9.1'], | 26 require => Package['ruby1.9.1'], |
27 before => Package['bundler'] | 27 before => Package['bundler'] |
28 } | 28 } |
29 | 29 |
30 package {'bundler': | 30 package {'bundler': |
31 ensure => present, | 31 ensure => present, |
32 provider => gem | 32 provider => gem |
33 } | 33 } |
34 | 34 |
35 $gem_dependencies = ['git', 'build-essential', 'ruby1.9.1-dev', 'libxml2-dev', | 35 $gem_dependencies = ['git', 'build-essential', 'ruby1.9.1-dev', 'libxml2-dev', |
36 'libxslt-dev', 'libpq-dev', 'libfcgi-dev'] | 36 'libxslt-dev', 'libpq-dev'] |
37 package {$gem_dependencies: ensure => present} | 37 package {$gem_dependencies: ensure => present} |
38 | 38 |
39 file {'/opt/discourse': | 39 file {'/opt/discourse': |
40 ensure => directory, | 40 ensure => directory, |
41 mode => 755, | 41 mode => 755, |
42 owner => discourse, | 42 owner => discourse, |
43 group => www-data | 43 group => www-data |
44 } | 44 } |
45 | 45 |
46 file {'/opt/discourse/discourse.fcgi': | |
47 mode => 755, | |
48 owner => discourse, | |
49 group => www-data, | |
50 source => 'puppet:///modules/discourse/discourse.fcgi', | |
51 require => Exec['fetch-discourse'] | |
52 } | |
53 | |
54 file {'/opt/discourse/config/database.yml': | 46 file {'/opt/discourse/config/database.yml': |
55 mode => 600, | 47 mode => 600, |
56 owner => discourse, | 48 owner => discourse, |
57 group => www-data, | 49 group => www-data, |
58 source => 'puppet:///modules/discourse/database.yml', | 50 source => 'puppet:///modules/discourse/database.yml', |
59 require => Exec['fetch-discourse'] | 51 require => Exec['fetch-discourse'] |
60 } | 52 } |
61 | 53 |
62 file {'/opt/discourse/config/redis.yml': | 54 file {'/opt/discourse/config/redis.yml': |
63 mode => 600, | 55 mode => 600, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 subscribe => File['/usr/local/bin/init-discourse'], | 97 subscribe => File['/usr/local/bin/init-discourse'], |
106 refreshonly => true, | 98 refreshonly => true, |
107 environment => ["DISCOURSE_SECRET=${secret}", "AIRBRAKE_KEY=${airbrake_key}"
], | 99 environment => ["DISCOURSE_SECRET=${secret}", "AIRBRAKE_KEY=${airbrake_key}"
], |
108 user => discourse, | 100 user => discourse, |
109 group => www-data, | 101 group => www-data, |
110 timeout => 0, | 102 timeout => 0, |
111 logoutput => true, | 103 logoutput => true, |
112 require => [Package['bundler', 'postgresql-contrib', $gem_dependencies], | 104 require => [Package['bundler', 'postgresql-contrib', $gem_dependencies], |
113 User['discourse'], File['/etc/sudoers.d/discourse'], | 105 User['discourse'], File['/etc/sudoers.d/discourse'], |
114 Exec['fetch-discourse'], | 106 Exec['fetch-discourse'], |
115 File['/opt/discourse/discourse.fcgi'], | |
116 File['/opt/discourse/config/database.yml'], | 107 File['/opt/discourse/config/database.yml'], |
117 File['/opt/discourse/config/redis.yml']] | 108 File['/opt/discourse/config/redis.yml']] |
118 } | 109 } |
119 | 110 |
120 Discourse::Sitesetting <| |> { | 111 Discourse::Sitesetting <| |> { |
121 require => Exec['/usr/local/bin/init-discourse'] | 112 require => Exec['/usr/local/bin/init-discourse'] |
122 } | 113 } |
123 | 114 |
124 discourse::sitesetting {'title': | 115 discourse::sitesetting {'title': |
125 ensure => present, | 116 ensure => present, |
(...skipping 23 matching lines...) Expand all Loading... |
149 ensure => present, | 140 ensure => present, |
150 type => 5, | 141 type => 5, |
151 value => 't' | 142 value => 't' |
152 } | 143 } |
153 | 144 |
154 discourse::admin {$admins: | 145 discourse::admin {$admins: |
155 ensure => present, | 146 ensure => present, |
156 require => Exec['/usr/local/bin/init-discourse'] | 147 require => Exec['/usr/local/bin/init-discourse'] |
157 } | 148 } |
158 | 149 |
159 class {'spawn-fcgi':} | |
160 | |
161 spawn-fcgi::pool {'discourse-fastcgi': | |
162 ensure => 'present', | |
163 user => 'discourse', | |
164 group => 'www-data', | |
165 mode => 0664, | |
166 fcgi_app => '/opt/discourse/discourse.fcgi', | |
167 socket => '/tmp/discourse-fastcgi.sock', | |
168 require => File['/opt/discourse/discourse.fcgi'], | |
169 } | |
170 | |
171 Discourse::Customservice <| |> { | 150 Discourse::Customservice <| |> { |
172 user => 'discourse', | 151 user => 'discourse', |
173 workdir => '/opt/discourse', | 152 workdir => '/opt/discourse', |
174 env => ['GEM_HOME=~discourse/.gems', 'RAILS_ENV=production'], | 153 env => ['GEM_HOME=~discourse/.gems', 'RAILS_ENV=production'], |
175 require => Exec['/usr/local/bin/init-discourse'] | 154 require => Exec['/usr/local/bin/init-discourse'] |
176 } | 155 } |
177 | 156 |
| 157 discourse::customservice {'discourse-thin': |
| 158 command => 'bundle exec thin -S /tmp/discourse-thin.sock start' |
| 159 } |
| 160 |
178 discourse::customservice {'sidekiq': | 161 discourse::customservice {'sidekiq': |
179 command => 'bundle exec sidekiq' | 162 command => 'bundle exec sidekiq' |
180 } | 163 } |
181 | 164 |
182 discourse::customservice {'clockwork': | 165 discourse::customservice {'clockwork': |
183 command => 'bundle exec clockwork config/clock.rb' | 166 command => 'bundle exec clockwork config/clock.rb' |
184 } | 167 } |
185 | 168 |
186 class {'nginx': | 169 class {'nginx': |
187 worker_processes => 1, | 170 worker_processes => 1, |
(...skipping 21 matching lines...) Expand all Loading... |
209 source => 'puppet:///modules/discourse/intraforum.adblockplus.org', | 192 source => 'puppet:///modules/discourse/intraforum.adblockplus.org', |
210 enabled => true | 193 enabled => true |
211 } | 194 } |
212 | 195 |
213 file {'/etc/logrotate.d/nginx_intraforum.adblockplus.org': | 196 file {'/etc/logrotate.d/nginx_intraforum.adblockplus.org': |
214 ensure => file, | 197 ensure => file, |
215 require => Nginx::Hostconfig['intraforum.adblockplus.org'], | 198 require => Nginx::Hostconfig['intraforum.adblockplus.org'], |
216 source => 'puppet:///modules/discourse/logrotate' | 199 source => 'puppet:///modules/discourse/logrotate' |
217 } | 200 } |
218 } | 201 } |
OLD | NEW |