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

Side by Side Diff: modules/adblockplus/manifests/legacy/issueserver.pp

Issue 29497628: #1255 - Move issuetracker configuration from nodes.pp to hiera (Closed)
Patch Set: Created July 25, 2017, 4: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
« no previous file with comments | « manifests/site.pp ('k') | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # == Class: adblockplus::legacy::issueserver
2 #
3 # A container for migrating obsolete resources in issueserver1, formerly located
4 # in manifests/issueserver.pp.
5 #
6 # See http://hub.eyeo.com/issues/1255 for more information.
7 #
8 class adblockplus::legacy::issueserver {
9 include private::trac
mathias 2017/07/25 18:06:53 Please add an empty line above this one.
10
11 class {'trac':
12 domain => 'issues.adblockplus.org',
13 certificate => 'issues.adblockplus.org_sslcert.pem',
14 private_key => 'issues.adblockplus.org_sslcert.key',
15 is_default => true,
16 }
17
18 trac::instance {'issues':
19 config => 'trac/trac.ini.erb',
20 description => 'Adblock Plus Issue Tracker',
21 location => '/',
22 logo => 'puppet:///modules/trac/adblockplus_logo.png',
23 database => 'trac',
24 permissions => "puppet:///modules/trac/permissions.csv",
25 }
26
27 trac::instance {'orders':
28 config => 'trac/orders.ini.erb',
29 description => 'Eyeo Order System',
30 location => '/orders',
31 logo => 'puppet:///modules/trac/eyeo_logo.png',
32 database => 'trac_orders',
33 permissions => "puppet:///modules/trac/order-permissions.csv",
34 }
35
36 # Transforming the auth_cookie table of the "new" Trac project into an
37 # insertable view for the "old" project's table of the same name avoids
38 # the need to convert the entire auth to htpasswd-file handling, which
39 # would be the official way to go for achieving a shared authentication.
40 exec { 'trac_auth_cookie_view':
41 command => "mysql -utrac -p'${private::trac::database_password}' trac_orders --execute '
42 DROP TABLE IF EXISTS auth_cookie;
43 CREATE VIEW auth_cookie AS SELECT * FROM trac.auth_cookie;'",
44 unless => "mysql -utrac -p'${private::trac::database_password}' trac_orders --execute '
45 SHOW CREATE VIEW auth_cookie'",
46 path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin",
47 require => [
48 Exec["deploy_issues"],
49 Exec["deploy_orders"],
50 ],
51 }
52
53 $mysql = "mysql -utrac -p'${private::trac::database_password}'"
54
55 # Synchronizing e-mail and password information between the project
56 # allows for logging in from any entry point - whilst maintaining a
57 # registration form (and process) in one project only.
58 cron {'trac_session_attribute_sync':
59 ensure => present,
60 user => trac,
61 minute => '*/30',
62 command => "$mysql trac_orders --execute ' \
63 INSERT INTO session_attribute (sid, authenticated, name, value) SELECT sid , authenticated, name, value \
64 FROM trac.session_attribute WHERE authenticated = 1 AND name IN (\"email\" , \"password\") \
65 ON DUPLICATE KEY UPDATE value=VALUES(value) ' >/dev/null
66 ",
67 require => Exec['trac_auth_cookie_view'],
68 }
69
70 cron {'trac_session_cleanup':
71 command => "$mysql trac --execute ' \
72 DELETE session, session_attribute FROM session \
73 JOIN session_attribute ON session.sid = session_attribute.sid \
74 AND session.authenticated = session_attribute.authenticated \
75 WHERE session.authenticated = 0 AND \
76 session.last_visit < UNIX_TIMESTAMP(NOW() - INTERVAL 10 DAY)' >/dev/null",
77 ensure => present,
78 hour => 1,
79 minute => 15,
80 require => Trac::Instance['issues'],
81 user => trac,
82 }
83
84 cron {'trac_account_cleanup':
85 command => "$mysql trac --execute ' \
86 DELETE session, session_attribute FROM session \
87 JOIN session_attribute AS session_data ON session.sid = session_data.sid \
88 AND session.authenticated = session_data.authenticated \
89 JOIN session_attribute ON session.sid = session_attribute.sid \
90 AND session.authenticated = session_attribute.authenticated \
91 WHERE session_data.name = \"email_verification_token\" AND \
92 session.last_visit < UNIX_TIMESTAMP(NOW() - INTERVAL 5 DAY)' >/dev/null",
93 ensure => present,
94 hour => 2,
95 minute => 15,
96 require => Trac::Instance['issues'],
97 user => trac,
98 }
99
100 # https://issues.adblockplus.org/ticket/3787
101 customservice::supervisor {"spawn-fcgi":
102 ensure => 'present',
103 pidfile => "/var/run/500-tracd_issues_spawn-fcgi.pid",
104 }
105 }
106
OLDNEW
« no previous file with comments | « manifests/site.pp ('k') | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld