OLD | NEW |
1 class 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 |
11 } | 11 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 owner => root, | 88 owner => root, |
89 group => root, | 89 group => root, |
90 mode => 0440, | 90 mode => 0440, |
91 source => 'puppet:///modules/discourse/sudoers', | 91 source => 'puppet:///modules/discourse/sudoers', |
92 require => User['discourse'] | 92 require => User['discourse'] |
93 } | 93 } |
94 | 94 |
95 exec {'fetch-discourse': | 95 exec {'fetch-discourse': |
96 command => "hg clone https://hg.adblockplus.org/discourse /opt/discourse", | 96 command => "hg clone https://hg.adblockplus.org/discourse /opt/discourse", |
97 path => ["/usr/bin/", "/bin/"], | 97 path => ["/usr/bin/", "/bin/"], |
| 98 environment => ["DISCOURSE_SECRET=${secret}"], |
98 user => discourse, | 99 user => discourse, |
99 group => www-data, | 100 group => www-data, |
100 require => [Package['mercurial'], File['/opt/discourse']], | 101 require => [Package['mercurial'], File['/opt/discourse']], |
101 onlyif => "test ! -d /opt/discourse/.hg" | 102 onlyif => "test ! -d /opt/discourse/.hg" |
102 } | 103 } |
103 | 104 |
104 exec {'/usr/local/bin/init-discourse': | 105 exec {'/usr/local/bin/init-discourse': |
105 subscribe => File['/usr/local/bin/init-discourse'], | 106 subscribe => File['/usr/local/bin/init-discourse'], |
106 refreshonly => true, | 107 refreshonly => true, |
107 user => discourse, | 108 user => discourse, |
108 group => www-data, | 109 group => www-data, |
109 timeout => 0, | 110 timeout => 0, |
110 logoutput => true, | 111 logoutput => true, |
111 require => [Package['bundler', 'postgresql-contrib', $gem_dependencies], | 112 require => [Package['bundler', 'postgresql-contrib', $gem_dependencies], |
112 User['discourse'], File['/etc/sudoers.d/discourse'], | 113 User['discourse'], File['/etc/sudoers.d/discourse'], |
113 Exec['fetch-discourse'], | 114 Exec['fetch-discourse'], |
114 File['/opt/discourse/discourse.fcgi'], | 115 File['/opt/discourse/discourse.fcgi'], |
115 File['/opt/discourse/config/database.yml'], | 116 File['/opt/discourse/config/database.yml'], |
116 File['/opt/discourse/config/redis.yml']] | 117 File['/opt/discourse/config/redis.yml']] |
117 } | 118 } |
118 | 119 |
| 120 discourse::sitesetting {'title': |
| 121 ensure => present, |
| 122 type => 1, |
| 123 value => 'Adblock Plus internal discussions', |
| 124 require => Exec['/usr/local/bin/init-discourse'] |
| 125 } |
| 126 |
| 127 discourse::sitesetting {'notification_email': |
| 128 ensure => present, |
| 129 type => 1, |
| 130 value => 'donotreply@adblockplus.org', |
| 131 require => Exec['/usr/local/bin/init-discourse'] |
| 132 } |
| 133 |
| 134 discourse::sitesetting {'must_approve_users': |
| 135 ensure => present, |
| 136 type => 5, |
| 137 value => 't', |
| 138 require => Exec['/usr/local/bin/init-discourse'] |
| 139 } |
| 140 |
| 141 discourse::sitesetting {'email_domains_blacklist': |
| 142 ensure => present, |
| 143 type => 1, |
| 144 value => '', |
| 145 require => Exec['/usr/local/bin/init-discourse'] |
| 146 } |
| 147 |
| 148 discourse::sitesetting {'use_ssl': |
| 149 ensure => present, |
| 150 type => 5, |
| 151 value => 't', |
| 152 require => Exec['/usr/local/bin/init-discourse'] |
| 153 } |
| 154 |
| 155 discourse::admin {$admins: |
| 156 ensure => present, |
| 157 require => Exec['/usr/local/bin/init-discourse'] |
| 158 } |
| 159 |
119 class {'spawn-fcgi':} | 160 class {'spawn-fcgi':} |
120 | 161 |
121 spawn-fcgi::pool {'discourse-fastcgi': | 162 spawn-fcgi::pool {'discourse-fastcgi': |
122 ensure => 'present', | 163 ensure => 'present', |
123 user => 'discourse', | 164 user => 'discourse', |
124 group => 'www-data', | 165 group => 'www-data', |
125 mode => 0664, | 166 mode => 0664, |
126 fcgi_app => '/opt/discourse/discourse.fcgi', | 167 fcgi_app => '/opt/discourse/discourse.fcgi', |
127 socket => '/tmp/discourse-fastcgi.sock', | 168 socket => '/tmp/discourse-fastcgi.sock', |
128 require => File['/opt/discourse/discourse.fcgi'], | 169 require => File['/opt/discourse/discourse.fcgi'], |
(...skipping 25 matching lines...) Expand all Loading... |
154 source => 'puppet:///modules/discourse/intraforum.adblockplus.org', | 195 source => 'puppet:///modules/discourse/intraforum.adblockplus.org', |
155 enabled => true | 196 enabled => true |
156 } | 197 } |
157 | 198 |
158 file {'/etc/logrotate.d/nginx_intraforum.adblockplus.org': | 199 file {'/etc/logrotate.d/nginx_intraforum.adblockplus.org': |
159 ensure => file, | 200 ensure => file, |
160 require => Nginx::Hostconfig['intraforum.adblockplus.org'], | 201 require => Nginx::Hostconfig['intraforum.adblockplus.org'], |
161 source => 'puppet:///modules/discourse/logrotate' | 202 source => 'puppet:///modules/discourse/logrotate' |
162 } | 203 } |
163 } | 204 } |
OLD | NEW |