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

Unified Diff: manifests/webserver.pp

Issue 4808447505727488: Issue 2301 - Improve beta.adblockplus.org configuration (Closed)
Patch Set: Created April 15, 2015, 12:20 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: manifests/webserver.pp
===================================================================
--- a/manifests/webserver.pp
+++ b/manifests/webserver.pp
@@ -34,13 +34,55 @@ template=formmail/template/eyeo.mail',
node 'web2' {
include statsclient
class {'web::server':
vhost => 'beta.adblockplus.org',
certificate => 'beta.adblockplus.org_sslcert.pem',
private_key => 'beta.adblockplus.org_sslcert.key',
is_default => true,
+ custom_config => template('web/adblockplus.org.conf.erb'),
repository => 'web.adblockplus.org',
- # Hack: This server doesn't need multiplexer but it needs sitescripts
- multiplexer_locations => [],
+ multiplexer_locations => ['/getSubscription'],
+ }
+
+ $sitescripts_var_dir = '/var/lib/sitescripts'
+ $subscriptions_repo = "${sitescripts_var_dir}/subscriptionlist"
+
+ concat::fragment {'formmail_template':
+ target => '/etc/sitescripts.ini',
+ content => "
+[multiplexer]
+sitescripts.subscriptions.web.fallback =
+[subscriptions]
+repository=$sitescripts_var_dir/subscriptionlist",
+ }
+
+ user {'sitescripts':
+ ensure => present,
+ home => $sitescripts_var_dir
+ }
+
+ file {$sitescripts_var_dir:
+ ensure => directory,
+ mode => 0755,
+ owner => 'sitescripts',
+ group => 'sitescripts'
+ }
+
+ exec {'fetch_repository_subscriptionlist':
+ command => "hg clone --noupdate https://hg.adblockplus.org/subscriptionlist $subscriptions_repo",
+ path => '/usr/local/bin:/usr/bin:/bin',
+ user => 'sitescripts',
+ timeout => 0,
+ onlyif => "test ! -d $subscriptions_repo",
+ require => [Package['mercurial'], File[$sitescripts_var_dir]]
+ }
+
+ cron {'update_repository_subscriptionlist':
+ ensure => present,
+ environment => ['MAILTO=admins@adblockplus.org'],
+ command => "hg pull --quiet --repository $subscriptions_repo",
+ user => 'sitescripts',
+ minute => '*/10',
+ require => Exec['fetch_repository_subscriptionlist']
}
}
« no previous file with comments | « no previous file | modules/web/templates/adblockplus.org.conf.erb » ('j') | modules/web/templates/adblockplus.org.conf.erb » ('J')

Powered by Google App Engine
This is Rietveld