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

Unified Diff: modules/discourse/manifests/init.pp

Issue 9351210: Define Discourse admins and site settings in Puppet, separate private data from other settings (Closed)
Patch Set: Created Feb. 19, 2013, 3:08 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: modules/discourse/manifests/init.pp
===================================================================
--- a/modules/discourse/manifests/init.pp
+++ b/modules/discourse/manifests/init.pp
@@ -1,9 +1,9 @@
-class discourse {
+class discourse inherits private::discourse {
include postgresql::server
postgresql::database {'discourse':}
postgresql::role {'discourse':
password_hash => 'vagrant',
db => 'discourse',
login => true,
@@ -90,16 +90,17 @@ class discourse {
mode => 0440,
source => 'puppet:///modules/discourse/sudoers',
require => User['discourse']
}
exec {'fetch-discourse':
command => "hg clone https://hg.adblockplus.org/discourse /opt/discourse",
path => ["/usr/bin/", "/bin/"],
+ environment => ["DISCOURSE_SECRET=${secret}"],
user => discourse,
group => www-data,
require => [Package['mercurial'], File['/opt/discourse']],
onlyif => "test ! -d /opt/discourse/.hg"
}
exec {'/usr/local/bin/init-discourse':
subscribe => File['/usr/local/bin/init-discourse'],
@@ -111,16 +112,56 @@ class discourse {
require => [Package['bundler', 'postgresql-contrib', $gem_dependencies],
User['discourse'], File['/etc/sudoers.d/discourse'],
Exec['fetch-discourse'],
File['/opt/discourse/discourse.fcgi'],
File['/opt/discourse/config/database.yml'],
File['/opt/discourse/config/redis.yml']]
}
+ discourse::sitesetting {'title':
Felix Dahlke 2013/02/21 15:27:40 You could do something like this to reduce redunda
+ ensure => present,
+ type => 1,
+ value => 'Adblock Plus internal discussions',
+ require => Exec['/usr/local/bin/init-discourse']
+ }
+
+ discourse::sitesetting {'notification_email':
+ ensure => present,
+ type => 1,
+ value => 'donotreply@adblockplus.org',
+ require => Exec['/usr/local/bin/init-discourse']
+ }
+
+ discourse::sitesetting {'must_approve_users':
+ ensure => present,
+ type => 5,
+ value => 't',
+ require => Exec['/usr/local/bin/init-discourse']
+ }
+
+ discourse::sitesetting {'email_domains_blacklist':
+ ensure => present,
+ type => 1,
+ value => '',
+ require => Exec['/usr/local/bin/init-discourse']
+ }
+
+ discourse::sitesetting {'use_ssl':
+ ensure => present,
+ type => 5,
+ value => 't',
+ require => Exec['/usr/local/bin/init-discourse']
+ }
+
+ discourse::admin {$admins:
+ ensure => present,
+ require => Exec['/usr/local/bin/init-discourse']
+ }
+
class {'spawn-fcgi':}
spawn-fcgi::pool {'discourse-fastcgi':
ensure => 'present',
user => 'discourse',
group => 'www-data',
mode => 0664,
fcgi_app => '/opt/discourse/discourse.fcgi',

Powered by Google App Engine
This is Rietveld