Andrew Bogott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/204256

Change subject: Clean up expired keystone tokens.
......................................................................

Clean up expired keystone tokens.

It looks like we've been leaking tokens for ages, which is making the keystone
database gigantic.

Bug T88256 (maybe)

Change-Id: I7a9a858529d66eb2193676945990d54b89ce931f
---
M modules/openstack/manifests/database-server.pp
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/56/204256/1

diff --git a/modules/openstack/manifests/database-server.pp 
b/modules/openstack/manifests/database-server.pp
index eebda02..83eeda2 100644
--- a/modules/openstack/manifests/database-server.pp
+++ b/modules/openstack/manifests/database-server.pp
@@ -172,4 +172,14 @@
             command => "/usr/bin/mysql -uroot --password='' mysql < 
/etc/nova/mysql.sql",
             require => [Class['mysql::server::package'], 
File['/etc/nova/mysql.sql']];
     }
+
+    # Clean up expired keystone tokens, because keystone seems to leak them
+    cron {
+        'run-jobs':
+            user    => 'root',
+            hour    => 8,
+            minute  => 0,
+            ensure  => present,
+            command => '/usr/bin/mysql $keystone_db_name -u${keystone_db_user} 
-p${keystone_db_pass} -e 'DELETE FROM token WHERE NOT 
DATE_SUB(CURDATE(),INTERVAL 2 DAY) <= expires;';
+    }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/204256
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a9a858529d66eb2193676945990d54b89ce931f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <abog...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to