 Issue 5735669590654976:
  #753 - set up an order system to let eyeo employees file order requests  (Closed)
    
  
    Issue 5735669590654976:
  #753 - set up an order system to let eyeo employees file order requests  (Closed) 
  | Left: | ||
| Right: | 
| OLD | NEW | 
|---|---|
| 1 node 'issues1' { | 1 node 'issues1' { | 
| 2 include base | 2 | 
| 3 include base, private::trac | |
| 3 | 4 | 
| 4 class {'trac': | 5 class {'trac': | 
| 5 domain => 'issues.adblockplus.org', | 6 domain => 'issues.adblockplus.org', | 
| 6 certificate => 'issues.adblockplus.org_sslcert.pem', | 7 certificate => 'issues.adblockplus.org_sslcert.pem', | 
| 7 private_key => 'issues.adblockplus.org_sslcert.key', | 8 private_key => 'issues.adblockplus.org_sslcert.key', | 
| 8 is_default => true, | 9 is_default => true, | 
| 9 } | 10 } | 
| 10 | 11 | 
| 12 trac::instance {'trac': | |
| 13 config => 'trac/trac.ini.erb', | |
| 14 description => 'Adblock Plus Issue Tracker', | |
| 15 environment => 'environment', | |
| 16 location => '/', | |
| 17 logo => 'adblockplus_logo.png', | |
| 18 database => 'trac', | |
| 19 } | |
| 20 | |
| 21 trac::instance {'orders': | |
| 22 config => 'trac/orders.ini.erb', | |
| 23 description => 'Eyeo Order System', | |
| 24 environment => 'environment-orders', | |
| 25 location => '/orders/', | |
| 26 logo => 'eyeo_logo.png', | |
| 27 database => 'trac_orders', | |
| 28 } | |
| 29 | |
| 30 # Transforming the auth_cookie table of the "new" Trac project into a | |
| 31 # federated uplink for the "old" project's table of the same name avoids | |
| 32 # the need to convert the entire auth to htpasswd-file handling, which | |
| 33 # would be the official way to go for achieving a shared authentication. | |
| 34 exec { 'trac_auth_cookie_federated': | |
| 35 command => "mysql -utrac -p'${private::trac::database_password}' trac --exec ute 'SHOW CREATE TABLE auth_cookie' -N \ | |
| 36 | cut -d' ' -f2 \ | |
| 37 | sed -e 's/auth_cookie/auth_cookie_federated/' -e 's/\\\\n//g' \ | |
| 38 -e 's/ENGINE=[A-Za-z]\\+/ENGINE=FEDERATED/' \ | |
| 39 -e 's/$/ CONNECTION=\"mysql:\\/\\/trac:${private::trac::database_pas sword}@localhost\\/trac\\/auth_cookie\";/' \ | |
| 40 -e 's/$/ RENAME TABLE auth_cookie TO auth_cookie_original, auth_cook ie_federated TO auth_cookie;/' \ | |
| 41 | mysql -utrac -p'${private::trac::database_password}' trac_orders | |
| 42 ", | |
| 43 unless => "mysql -utrac -p'${private::trac::database_password}' trac_orders --execute 'SHOW CREATE TABLE auth_cookie' | grep FEDERATED", | |
| 
Wladimir Palant
2014/07/22 13:52:24
This is quite complex, and there are lots of warni
 
mathias
2014/07/24 16:36:49
Sure, it does. Yet it does not allow to move to a
 | |
| 44 path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin", | |
| 45 require => [ | |
| 46 Exec["deploy_trac"], | |
| 47 Exec["deploy_orders"], | |
| 48 ], | |
| 49 } | |
| 50 | |
| 51 # Synchronizing e-mail and password information between the project | |
| 52 # allows for logging in from any entry point - whilst maintaining a | |
| 53 # registration form (and process) in one project only. | |
| 
Wladimir Palant
2014/07/22 13:52:24
Why do we want this table to be synced (rather inf
 
mathias
2014/07/24 16:36:49
Because the Trac software also stores other inform
 | |
| 54 cron {'trac_session_attribute_sync': | |
| 55 ensure => present, | |
| 56 user => trac, | |
| 57 minute => '*/30', | |
| 58 command => "mysql -utrac -p'${private::trac::database_password}' trac_orders --execute ' \ | |
| 59 INSERT INTO session_attribute (sid, authenticated, name, value) SELECT sid , authenticated, name, value \ | |
| 60 FROM trac.session_attribute WHERE authenticated = 1 AND name IN (\"email\" , \"password\") \ | |
| 61 ON DUPLICATE KEY UPDATE value=VALUES(value) ' >/dev/null | |
| 62 ", | |
| 63 require => Exec['trac_auth_cookie_federated'], | |
| 64 } | |
| 65 | |
| 11 class {'nagios::client': | 66 class {'nagios::client': | 
| 12 server_address => 'monitoring.adblockplus.org' | 67 server_address => 'monitoring.adblockplus.org' | 
| 13 } | 68 } | 
| 14 } | 69 } | 
| OLD | NEW |