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

Unified Diff: modules/web/manifests/server.pp

Issue 5728306397708288: Added definition for eyeo.com webserver (Closed)
Patch Set: Created Dec. 5, 2013, 9:32 a.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 | « modules/web/files/sitescripts ('k') | modules/web/templates/site.erb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/web/manifests/server.pp
===================================================================
new file mode 100644
--- /dev/null
+++ b/modules/web/manifests/server.pp
@@ -0,0 +1,72 @@
+class web::server($vhost, $repository) {
+ File {
+ owner => 'root',
+ group => 'root',
+ mode => 0644,
+ }
+
+ Cron {
+ environment => ['MAILTO=admin@adblockplus.org', 'PYTHONPATH=/opt/sitescripts'],
+ }
+
+ include nginx
+
+ package {['python-jinja2', 'python-markdown']:}
+
+ nginx::hostconfig {$vhost:
+ content => template('web/site.erb'),
+ enabled => true,
+ }
+
+ file {'/etc/nginx/sites-available/adblockplus.org_sslcert.key':
+ ensure => file,
+ mode => 0400,
+ require => Nginx::Hostconfig[$vhost],
+ source => 'puppet:///modules/private/adblockplus.org_sslcert.key',
+ }
+
+ file {'/etc/nginx/sites-available/adblockplus.org_sslcert.pem':
+ ensure => file,
+ mode => 0400,
+ require => Nginx::Hostconfig[$vhost],
+ source => 'puppet:///modules/private/adblockplus.org_sslcert.pem',
+ }
+
+ class {'sitescripts':
+ sitescriptsini_source => 'puppet:///modules/web/sitescripts',
+ }
+
+ user {'www':
+ ensure => present,
+ comment => 'Web content owner',
+ home => '/home/www',
+ managehome => true,
+ }
+
+ exec {"fetch_repo":
+ command => "hg clone -U https://hg.adblockplus.org/${repository} /home/www/${repository}",
+ path => ["/usr/bin/", "/bin/"],
+ require => Package['mercurial'],
+ user => www,
+ timeout => 0,
+ onlyif => "test ! -d /home/www/${repository}",
+ }
+
+ file {'/var/www':
+ ensure => directory,
+ mode => 755,
+ }
+
+ file {"/var/www/${vhost}":
+ ensure => directory,
+ owner => www,
+ mode => 755,
+ }
+
+ cron {'update_repo':
+ ensure => present,
+ command => "hg pull -q -R /home/www/${repository} && python -m sitescripts.cms.bin.generate_static_pages /home/www/${repository} /var/www/${vhost}",
+ user => www,
+ minute => '*/10',
+ }
+}
« no previous file with comments | « modules/web/files/sitescripts ('k') | modules/web/templates/site.erb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld