OLD | NEW |
1 class updateserver( | 1 class updateserver( |
2 $domain, | 2 $domain, |
3 $certificate, | 3 $certificate, |
4 $private_key, | 4 $private_key, |
5 $is_default=false | 5 $is_default=false |
6 ) { | 6 ) { |
7 class {'nginx': | 7 class {'nginx': |
8 worker_connections => 4000, | 8 worker_connections => 4000, |
9 ssl_session_cache => off, | 9 ssl_session_cache => off, |
10 } | 10 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 fetch_repository {$repositories_to_sync: } | 91 fetch_repository {$repositories_to_sync: } |
92 | 92 |
93 $update_update_manifests_script = '/usr/local/bin/update_update_manifests' | 93 $update_update_manifests_script = '/usr/local/bin/update_update_manifests' |
94 | 94 |
95 file {$update_update_manifests_script: | 95 file {$update_update_manifests_script: |
96 mode => '0755', | 96 mode => '0755', |
97 content => template('updateserver/update_update_manifests.erb') | 97 content => template('updateserver/update_update_manifests.erb') |
98 } | 98 } |
99 | 99 |
100 $update_update_manifests_dependencies = ['python-crypto', 'python-jinja2'] | 100 ensure_packages(['python-pip', 'python-dev']) |
101 | 101 |
102 package {$update_update_manifests_dependencies:} | 102 # Make sure that apt packages corresponding to the pip-installed modules below |
| 103 # won't be installed unintentionally, these will take precedence otherwise. |
| 104 package {['python-jinja2', 'python-crypto']: |
| 105 ensure => 'held', |
| 106 } |
| 107 |
| 108 package {'Jinja2': |
| 109 ensure => '2.8', |
| 110 provider => 'pip', |
| 111 require => [Package['python-pip'], Package['python-jinja2']], |
| 112 } |
| 113 |
| 114 package {'pycrypto': |
| 115 ensure => '2.6.1', |
| 116 provider => 'pip', |
| 117 require => [Package['python-pip'], Package['python-crypto'], Package['python
-dev']], |
| 118 } |
103 | 119 |
104 exec {'update_update_manifests': | 120 exec {'update_update_manifests': |
105 command => $update_update_manifests_script, | 121 command => $update_update_manifests_script, |
106 user => 'sitescripts', | 122 user => 'sitescripts', |
107 timeout => 0, | 123 timeout => 0, |
108 require => [Class['sitescripts'], | 124 require => [Class['sitescripts'], |
109 Fetch_repository[$repositories_to_sync], | 125 Fetch_repository[$repositories_to_sync], |
110 File[$update_update_manifests_script], | 126 File[$update_update_manifests_script], |
111 File[$update_manifest_dirs], File[$safari_certificate_path], | 127 File[$update_manifest_dirs], File[$safari_certificate_path], |
112 Package[$update_update_manifests_dependencies]] | 128 Package['Jinja2', 'pycrypto']] |
113 } | 129 } |
114 | 130 |
115 cron {'update_update_manifests': | 131 cron {'update_update_manifests': |
116 ensure => present, | 132 ensure => present, |
117 environment => ['MAILTO=admins@adblockplus.org'], | 133 environment => ['MAILTO=admins@adblockplus.org'], |
118 command => $update_update_manifests_script, | 134 command => $update_update_manifests_script, |
119 user => 'sitescripts', | 135 user => 'sitescripts', |
120 minute => '*/10', | 136 minute => '*/10', |
121 require => Exec['update_update_manifests'] | 137 require => Exec['update_update_manifests'] |
122 } | 138 } |
123 | 139 |
124 include spawn-fcgi | 140 include spawn-fcgi |
125 package {'python-flup':} | 141 package {'python-flup':} |
126 | 142 |
127 spawn-fcgi::pool {"multiplexer": | 143 spawn-fcgi::pool {"multiplexer": |
128 ensure => present, | 144 ensure => present, |
129 fcgi_app => '/opt/sitescripts/multiplexer.fcgi', | 145 fcgi_app => '/opt/sitescripts/multiplexer.fcgi', |
130 socket => '/tmp/multiplexer-fastcgi.sock', | 146 socket => '/tmp/multiplexer-fastcgi.sock', |
131 mode => '0666', | 147 mode => '0666', |
132 user => 'nginx', | 148 user => 'nginx', |
133 children => 1, | 149 children => 1, |
134 require => [ | 150 require => [ |
135 Class["sitescripts"], | 151 Class["sitescripts"], |
136 Package["python-flup"], | 152 Package["python-flup"], |
137 ], | 153 ], |
138 } | 154 } |
139 } | 155 } |
OLD | NEW |