Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: modules/discourse/manifests/init.pp

Issue 6221863587938304: Issue 212 - Update Discourse (Closed)
Left Patch Set: Created March 27, 2014, 3:37 p.m.
Right Patch Set: Disabled mini profiler Created March 28, 2014, 11:51 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « modules/discourse/manifests/admin.pp ('k') | modules/discourse/manifests/postactiontype.pp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 class discourse( 1 class discourse(
2 $domain, 2 $domain,
3 $is_default = false) inherits private::discourse { 3 $is_default = false
Felix Dahlke 2014/03/27 15:49:11 Nit: We usually break before ")" in argument lists
Wladimir Palant 2014/03/27 20:28:24 From what I can tell, the only other occasions are
4 ) inherits private::discourse {
5
4 include postgresql::server 6 include postgresql::server
5 7
6 postgresql::database {'discourse':} 8 postgresql::database {'discourse':}
7 9
8 postgresql::role {'discourse': 10 postgresql::role {'discourse':
9 password_hash => $database_password, 11 password_hash => $database_password,
10 db => 'discourse', 12 db => 'discourse',
11 login => true, 13 login => true,
12 superuser => true, 14 superuser => true,
13 require => Postgresql::Database['discourse'] 15 require => Postgresql::Database['discourse']
14 } 16 }
15 17
16 package {['postgresql-contrib', 'redis-server', 'ruby1.9.1', 'libjemalloc1', ' imagemagick']: 18 $basic_dependencies = ['postgresql-contrib', 'redis-server', 'ruby1.9.1',
19 'libjemalloc1', 'curl']
20 $gem_dependencies = ['git', 'build-essential', 'ruby1.9.1-dev', 'libxml2-dev',
21 'libxslt-dev', 'libpq-dev']
22 $image_optim_dependencies = ['advancecomp', 'gifsicle', 'jhead', 'jpegoptim',
23 'libjpeg-progs', 'optipng', 'pngcrush']
24 $image_sorcery_dependencies = 'imagemagick'
25
26 package {[$basic_dependencies, $gem_dependencies, $image_optim_dependencies, $ image_sorcery_dependencies]:
17 ensure => present 27 ensure => present
18 } 28 }
19 29
20 Exec {path => '/bin:/usr/bin:/usr/sbin:/usr/local/bin'} 30 Exec {path => '/bin:/usr/bin:/usr/sbin:/usr/local/bin'}
21 31
22 exec {'update-alternatives --set ruby "/usr/bin/ruby1.9.1"': 32 exec {'update-alternatives --set ruby "/usr/bin/ruby1.9.1"':
23 unless => 'test $(readlink "/etc/alternatives/ruby") == "/usr/bin/ruby1.9.1" ', 33 unless => 'test $(readlink "/etc/alternatives/ruby") == "/usr/bin/ruby1.9.1" ',
24 require => Package['ruby1.9.1'] 34 require => Package['ruby1.9.1']
25 } 35 }
26 36
27 exec {'update-alternatives --set gem "/usr/bin/gem1.9.1"': 37 exec {'update-alternatives --set gem "/usr/bin/gem1.9.1"':
28 unless => 'test $(readlink "/etc/alternatives/gem") == "/usr/bin/gem1.9.1"', 38 unless => 'test $(readlink "/etc/alternatives/gem") == "/usr/bin/gem1.9.1"',
29 require => Package['ruby1.9.1'], 39 require => Package['ruby1.9.1'],
30 before => Exec['/usr/bin/gem update --system 1.8.25'] 40 before => Exec['update_gem']
31 } 41 }
32 42
33 exec {'/usr/bin/gem update --system 1.8.25': 43 exec {'update_gem':
44 command => '/usr/bin/gem update --system 1.8.25',
34 unless => 'test $(gem -v) == "1.8.25"', 45 unless => 'test $(gem -v) == "1.8.25"',
35 environment => 'REALLY_GEM_UPDATE_SYSTEM=1', 46 environment => 'REALLY_GEM_UPDATE_SYSTEM=1',
36 before => Package['bundler'],
37 } 47 }
38 48
39 package {'bundler': 49 package {'bundler':
40 ensure => present, 50 ensure => present,
41 provider => gem 51 provider => gem,
42 } 52 require => Exec['update_gem']
43 53 }
44 $gem_dependencies = ['git', 'build-essential', 'ruby1.9.1-dev', 'libxml2-dev', 54
45 'libxslt-dev', 'libpq-dev'] 55 file {'/opt/discourse':
46 package {$gem_dependencies: ensure => present}
47
48 file {['/opt/discourse', '/opt/discourse/tmp', '/opt/discourse/tmp/pids']:
49 ensure => directory, 56 ensure => directory,
50 mode => 755, 57 mode => 755,
51 owner => discourse, 58 owner => discourse,
52 group => www-data 59 group => www-data
60 }
61
62 file {['/opt/discourse/tmp', '/opt/discourse/tmp/pids']:
63 ensure => directory,
64 mode => 755,
65 owner => discourse,
66 group => www-data,
67 require => Exec['fetch-discourse']
53 } 68 }
54 69
55 file {'/opt/discourse/config/discourse.conf': 70 file {'/opt/discourse/config/discourse.conf':
56 mode => 600, 71 mode => 600,
57 owner => discourse, 72 owner => discourse,
58 group => www-data, 73 group => www-data,
59 content => template('discourse/discourse.conf.erb'), 74 content => template('discourse/discourse.conf.erb'),
60 notify => Service['discourse'], 75 notify => Service['discourse'],
61 require => Exec['fetch-discourse'] 76 require => Exec['fetch-discourse']
62 } 77 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 112 }
98 113
99 exec {'/usr/local/bin/init-discourse': 114 exec {'/usr/local/bin/init-discourse':
100 subscribe => File['/usr/local/bin/init-discourse'], 115 subscribe => File['/usr/local/bin/init-discourse'],
101 refreshonly => true, 116 refreshonly => true,
102 environment => ["AIRBRAKE_KEY=${airbrake_key}"], 117 environment => ["AIRBRAKE_KEY=${airbrake_key}"],
103 user => discourse, 118 user => discourse,
104 group => www-data, 119 group => www-data,
105 timeout => 0, 120 timeout => 0,
106 logoutput => true, 121 logoutput => true,
107 require => [Package['bundler', 'postgresql-contrib', $gem_dependencies], 122 require => [Package['bundler', $gem_dependencies],
108 User['discourse'], File['/etc/sudoers.d/discourse'], 123 User['discourse'], File['/etc/sudoers.d/discourse'],
109 Exec['fetch-discourse'], 124 Exec['fetch-discourse'],
110 File['/opt/discourse/config/discourse.conf'], 125 File['/opt/discourse/config/discourse.conf'],
111 Postgresql::Role['discourse']] 126 Postgresql::Role['discourse']]
112 } 127 }
113 128
114 Discourse::Sitesetting <| |> { 129 Discourse::Sitesetting <| |> {
115 require => Exec['/usr/local/bin/init-discourse'] 130 require => Exec['/usr/local/bin/init-discourse']
116 } 131 }
117 132
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 type => 1, 171 type => 1,
157 value => '' 172 value => ''
158 } 173 }
159 174
160 discourse::sitesetting {'email_domains_whitelist': 175 discourse::sitesetting {'email_domains_whitelist':
161 ensure => present, 176 ensure => present,
162 type => 1, 177 type => 1,
163 value => 'adblockplus.org|eyeo.com' 178 value => 'adblockplus.org|eyeo.com'
164 } 179 }
165 180
166 discourse::sitesetting {'use_ssl': 181 discourse::sitesetting {'use_https':
167 ensure => present, 182 ensure => present,
168 type => 5, 183 type => 5,
169 value => 't' 184 value => 't'
170 } 185 }
171 186
172 discourse::sitesetting {'company_full_name': 187 discourse::sitesetting {'company_full_name':
173 ensure => present, 188 ensure => present,
174 type => 1, 189 type => 1,
175 value => 'Eyeo GmbH' 190 value => 'Eyeo GmbH'
176 } 191 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 type => 5, 237 type => 5,
223 value => 'f' 238 value => 'f'
224 } 239 }
225 240
226 discourse::sitesetting {'enforce_global_nicknames': 241 discourse::sitesetting {'enforce_global_nicknames':
227 ensure => present, 242 ensure => present,
228 type => 5, 243 type => 5,
229 value => 'f' 244 value => 'f'
230 } 245 }
231 246
232 Discourse::Postactiontype <| |> { 247 discourse::sitesetting {'allow_user_locale':
233 require => Exec['/usr/local/bin/init-discourse'] 248 ensure => present,
234 } 249 type => 5,
235 250 value => 't'
236 discourse::postactiontype {'bookmark': 251 }
237 ensure => present, 252
238 id => 1, 253 discourse::sitesetting {'white_listed_spam_host_domains':
239 position => 1 254 ensure => present,
240 } 255 type => 1,
241 256 value => 'adblockplus.org,eyeo.com'
242 discourse::postactiontype {'like':
243 ensure => present,
244 id => 2,
245 position => 2,
246 icon => 'heart'
247 }
248
249 discourse::postactiontype {'off_topic':
250 ensure => present,
251 id => 3,
252 position => 3,
253 is_flag => true
254 }
255
256 discourse::postactiontype {'inappropriate':
257 ensure => present,
258 id => 4,
259 position => 4,
260 is_flag => true
261 }
262
263 discourse::postactiontype {'vote':
264 ensure => present,
265 position => 5,
266 id => 5
267 }
268
269 discourse::postactiontype {'custom_flag':
270 ensure => present,
271 id => 6,
272 position => 7,
273 is_flag => true
274 }
275
276 discourse::postactiontype {'spam':
277 ensure => present,
278 id => 7,
279 position => 6,
280 is_flag => true
281 } 257 }
282 258
283 Discourse::Customservice <| |> { 259 Discourse::Customservice <| |> {
284 user => 'discourse', 260 user => 'discourse',
285 workdir => '/opt/discourse', 261 workdir => '/opt/discourse',
286 env => ['RAILS_ENV=production', 'RUBY_GC_MALLOC_LIMIT=90000000', 262 env => ['RAILS_ENV=production', 'RUBY_GC_MALLOC_LIMIT=90000000',
287 'UNICORN_WORKERS=2', 'LD_PRELOAD=/usr/lib/libjemalloc.so.1'], 263 'UNICORN_WORKERS=2', 'LD_PRELOAD=/usr/lib/libjemalloc.so.1'],
288 require => Exec['/usr/local/bin/init-discourse'] 264 require => Exec['/usr/local/bin/init-discourse']
289 } 265 }
290 266
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 content => template('discourse/site.erb'), 299 content => template('discourse/site.erb'),
324 enabled => true 300 enabled => true
325 } 301 }
326 302
327 file {"/etc/logrotate.d/nginx_$domain": 303 file {"/etc/logrotate.d/nginx_$domain":
328 ensure => file, 304 ensure => file,
329 require => Nginx::Hostconfig[$domain], 305 require => Nginx::Hostconfig[$domain],
330 source => 'puppet:///modules/discourse/logrotate' 306 source => 'puppet:///modules/discourse/logrotate'
331 } 307 }
332 } 308 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld