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

Unified Diff: modules/adblockplus/manifests/legacy/webserver.pp

Issue 29483575: #2007 - Create abp::legacy::webserver class for hiera compatibility (Closed)
Patch Set: For comment 9 and 10 Created July 12, 2017, 7: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
« no previous file with comments | « manifests/webserver.pp ('k') | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplus/manifests/legacy/webserver.pp
===================================================================
new file mode 100644
--- /dev/null
+++ b/modules/adblockplus/manifests/legacy/webserver.pp
@@ -0,0 +1,77 @@
+# == Class: adblockplus::legacy::webserver
+#
+# A container for migrating obsolete resources in web2, formerly located
+# in manifests/webserver.pp.
+#
+# See http://hub.eyeo.com/issues/2007 for more information.
+#
+class adblockplus::legacy::webserver {
+
+ class {'web::server':
+ vhost => 'adblockplus.org',
+ certificate => 'adblockplus.org_sslcert.pem',
+ private_key => 'adblockplus.org_sslcert.key',
+ is_default => true,
+ aliases => ['www.adblockplus.org'],
+ custom_config => template("web/adblockplus.org.conf.erb"),
+ repository => 'web.adblockplus.org',
+ multiplexer_locations => ['/getSubscription'],
+ geoip => true,
+ }
+
+ ensure_packages([
+ 'make',
+ 'doxygen',
+ ])
+
+ $subscription_repo = '/home/www/subscriptionlist'
+
+ $fetch_repo_cmd = [
+ 'hg', 'clone',
+ '--noupdate',
+ 'https://hg.adblockplus.org/subscriptionlist',
+ $subscription_repo,
+ ]
+
+ exec {'fetch_repository_subscriptionlist':
+ command => shellquote($fetch_repo_cmd),
+ path => '/usr/local/bin:/usr/bin:/bin',
+ user => 'www',
+ timeout => 0,
+ onlyif => "test ! -d $subscription_repo",
+ require => Class['web::server'],
+ }
+
+ $update_repo_cmd = [
+ 'hg', 'pull',
+ '--quiet', '--repository',
+ $subscription_repo,
+ ]
+
+ cron {'update_repository_subscriptionlist':
+ ensure => present,
+ environment => hiera('cron::environment', []),
+ command => shellquote($update_repo_cmd),
+ user => 'www',
+ minute => '1-59/20',
+ require => Exec['fetch_repository_subscriptionlist']
+ }
+
+ $generate_docs_cmd = [
+ 'python', '-m',
+ 'sitescripts.docs.bin.generate_docs',
+ ]
+
+ cron {'generate_docs':
+ ensure => 'present',
+ require => [
+ Class['sitescripts'],
+ Class['web::server'],
+ Class['nodejs'],
+ ],
+ command => shellquote($generate_docs_cmd),
+ user => www,
+ minute => '5-55/10',
+ }
+}
+
« no previous file with comments | « manifests/webserver.pp ('k') | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld