OLD | NEW |
(Empty) | |
| 1 class web::server($vhost, $repository) { |
| 2 File { |
| 3 owner => 'root', |
| 4 group => 'root', |
| 5 mode => 0644, |
| 6 } |
| 7 |
| 8 Cron { |
| 9 environment => ['MAILTO=admin@adblockplus.org', 'PYTHONPATH=/opt/sitescripts
'], |
| 10 } |
| 11 |
| 12 include nginx |
| 13 |
| 14 package {['python-jinja2', 'python-markdown']:} |
| 15 |
| 16 nginx::hostconfig {$vhost: |
| 17 content => template('web/site.erb'), |
| 18 enabled => true, |
| 19 } |
| 20 |
| 21 file {'/etc/nginx/sites-available/adblockplus.org_sslcert.key': |
| 22 ensure => file, |
| 23 mode => 0400, |
| 24 require => Nginx::Hostconfig[$vhost], |
| 25 source => 'puppet:///modules/private/adblockplus.org_sslcert.key', |
| 26 } |
| 27 |
| 28 file {'/etc/nginx/sites-available/adblockplus.org_sslcert.pem': |
| 29 ensure => file, |
| 30 mode => 0400, |
| 31 require => Nginx::Hostconfig[$vhost], |
| 32 source => 'puppet:///modules/private/adblockplus.org_sslcert.pem', |
| 33 } |
| 34 |
| 35 class {'sitescripts': |
| 36 sitescriptsini_source => 'puppet:///modules/web/sitescripts', |
| 37 } |
| 38 |
| 39 user {'www': |
| 40 ensure => present, |
| 41 comment => 'Web content owner', |
| 42 home => '/home/www', |
| 43 managehome => true, |
| 44 } |
| 45 |
| 46 exec {"fetch_repo": |
| 47 command => "hg clone -U https://hg.adblockplus.org/${repository} /home/www/$
{repository}", |
| 48 path => ["/usr/bin/", "/bin/"], |
| 49 require => Package['mercurial'], |
| 50 user => www, |
| 51 timeout => 0, |
| 52 onlyif => "test ! -d /home/www/${repository}", |
| 53 } |
| 54 |
| 55 file {'/var/www': |
| 56 ensure => directory, |
| 57 mode => 755, |
| 58 } |
| 59 |
| 60 file {"/var/www/${vhost}": |
| 61 ensure => directory, |
| 62 owner => www, |
| 63 mode => 755, |
| 64 } |
| 65 |
| 66 cron {'update_repo': |
| 67 ensure => present, |
| 68 command => "hg pull -q -R /home/www/${repository} && python -m sitescripts.c
ms.bin.generate_static_pages /home/www/${repository} /var/www/${vhost}", |
| 69 user => www, |
| 70 minute => '*/10', |
| 71 } |
| 72 } |
OLD | NEW |