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

Side by Side Diff: modules/statsmaster/manifests/init.pp

Issue 11464069: Set up statistics master server (Closed)
Patch Set: Created Aug. 23, 2013, 3:47 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 class statsmaster {
2 user {'stats':
3 ensure => present,
4 home => '/home/stats',
5 managehome => true,
6 }
7
8 file {'/home/stats/.ssh':
9 ensure => directory,
10 owner => stats,
11 mode => 0600,
12 require => User['stats'],
13 }
14
15 file {'/home/stats/.ssh/id_rsa':
16 ensure => present,
17 owner => stats,
18 mode => 0400,
19 source => 'puppet:///modules/private/stats@stats.adblockplus.org',
20 }
21
22 file {'/home/stats/.ssh/known_hosts':
23 ensure => present,
24 owner => stats,
25 mode => 0400,
26 source => 'puppet:///modules/statsmaster/known_hosts',
27 }
28
29 package {'python-simplejson':}
30
31 package {'python-jinja2':}
32
33 class {'sitescripts':
34 sitescriptsini_source => 'puppet:///modules/statsmaster/sitescripts.ini',
35 }
36
37 class {'nginx':
38 worker_processes => 2,
39 worker_connections => 4000,
40 ssl_session_cache => off,
41 }
42
43 File {
44 owner => root,
45 group => root,
46 }
47
48 file {'/var/www':
49 ensure => directory,
50 mode => 0755,
51 require => Package['nginx'],
52 }
53
54 file {'/var/www/stats':
55 ensure => directory,
56 mode => 0755,
57 owner => stats,
58 }
59
60 file {'/var/www/statsdata':
61 ensure => directory,
62 mode => 0755,
63 owner => stats,
64 }
65
66 file {'/var/www/htpasswd':
67 ensure => file,
68 mode => 0444,
69 source => 'puppet:///modules/private/stats-htpasswd',
70 }
71
72 file {'/etc/nginx/sites-available/adblockplus.org_sslcert.key':
73 ensure => file,
74 notify => Service['nginx'],
75 before => Nginx::Hostconfig['stats.adblockplus.org'],
76 mode => 0400,
77 source => 'puppet:///modules/private/adblockplus.org_sslcert.key'
78 }
79
80 file {'/etc/nginx/sites-available/adblockplus.org_sslcert.pem':
81 ensure => file,
82 notify => Service['nginx'],
83 before => Nginx::Hostconfig['stats.adblockplus.org'],
84 mode => 0400,
85 source => 'puppet:///modules/private/adblockplus.org_sslcert.pem'
86 }
87
88 nginx::hostconfig{'stats.adblockplus.org':
89 source => 'puppet:///modules/statsmaster/stats.adblockplus.org',
90 enabled => true
91 }
92
93 file {'/etc/logrotate.d/nginx_stats.adblockplus.org':
94 ensure => file,
95 mode => 0444,
96 require => Nginx::Hostconfig['stats.adblockplus.org'],
97 source => 'puppet:///modules/statsmaster/logrotate'
98 }
99
100 # TODO: Activate once old stats have been reprocessed
101 # cron {'updatestats':
102 # ensure => present,
103 # require => [
104 # User['stats'],
105 # Package['python-simplejson'],
106 # Package['python-jinja2'],
107 # Exec["fetch_sitescripts"]
108 # ],
109 # command => "python -m sitescripts.stats.bin.datamerger && python -m sitescr ipts.stats.bin.pagegenerator",
110 # environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/sitescrip ts'],
111 # user => stats,
112 # hour => 3,
113 # minute => 0,
114 # }
115 }
OLDNEW

Powered by Google App Engine
This is Rietveld