From c88ab2cb08d6f3bf6e5cb120b31c66b3cda0064e Mon Sep 17 00:00:00 2001 From: Seddik Alaoui Ismaili Date: Tue, 19 Nov 2024 22:00:30 +0100 Subject: [PATCH] test move apps to memcached02 --- roles/mailman3/templates/settings.py.j2 | 4 ++++ roles/mediawiki/templates/LocalSettings.php.fp.j2 | 6 +++++- roles/openshift-apps/badges/templates/tahrir.cfg.py | 4 ++++ .../openshift-apps/elections/templates/fedora-elections.cfg | 4 ++++ .../openshift-apps/koschei/templates/config-backend.cfg.j2 | 4 ++++ .../openshift-apps/koschei/templates/config-frontend.cfg.j2 | 4 ++++ roles/packages3/web/templates/packages-app.ini.j2 | 6 +++++- 7 files changed, 30 insertions(+), 2 deletions(-) diff --git a/roles/mailman3/templates/settings.py.j2 b/roles/mailman3/templates/settings.py.j2 index 5954ea4239..4fa7db99d9 100644 --- a/roles/mailman3/templates/settings.py.j2 +++ b/roles/mailman3/templates/settings.py.j2 @@ -392,7 +392,11 @@ LOGGING = { CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache', + {% if env == 'staging' %} + 'LOCATION': 'memcached02:11211', + {% else %} 'LOCATION': 'memcached01:11211', + {% endif %} } } diff --git a/roles/mediawiki/templates/LocalSettings.php.fp.j2 b/roles/mediawiki/templates/LocalSettings.php.fp.j2 index e715d32f3f..530c9441a1 100644 --- a/roles/mediawiki/templates/LocalSettings.php.fp.j2 +++ b/roles/mediawiki/templates/LocalSettings.php.fp.j2 @@ -158,7 +158,11 @@ $wgParserCacheType = CACHE_MEMCACHED; $wgMessageCacheType = CACHE_MEMCACHED; $wgSessionsInMemcached = true; $wgMemCachedServers = array ( - 0 => 'memcached01:11211', + {% if env == 'staging' %} + 0 => 'memcached02:11211', + {% else %} + 0 => 'memcached01:11211', + {% endif %} ); ## To enable image uploads, make sure the 'images' directory diff --git a/roles/openshift-apps/badges/templates/tahrir.cfg.py b/roles/openshift-apps/badges/templates/tahrir.cfg.py index 2004f57457..e09b66d0ce 100644 --- a/roles/openshift-apps/badges/templates/tahrir.cfg.py +++ b/roles/openshift-apps/badges/templates/tahrir.cfg.py @@ -51,7 +51,11 @@ CACHE = { "backend": "dogpile.cache.null", "expiration_time": 100, "arguments": { + {% if env == 'staging' %} + "url": "memcached02{{env_suffix}}:11211", + {% else %} "url": "memcached01{{env_suffix}}:11211", + {% endif %} "distributed_lock": True, "lock_timeout": 5, }, diff --git a/roles/openshift-apps/elections/templates/fedora-elections.cfg b/roles/openshift-apps/elections/templates/fedora-elections.cfg index 7b02830bd5..60e27c2b22 100644 --- a/roles/openshift-apps/elections/templates/fedora-elections.cfg +++ b/roles/openshift-apps/elections/templates/fedora-elections.cfg @@ -50,7 +50,11 @@ SESSION_COOKIE_NAME = 'elections' DOGPILE_CACHE = { 'backend': 'dogpile.cache.memcached', 'arguments': { + {% if env == 'staging' %} + 'url': ["memcached02:11211"], + {% else %} 'url': ["memcached01:11211"], + {% endif %} 'distributed_lock': True, }, } diff --git a/roles/openshift-apps/koschei/templates/config-backend.cfg.j2 b/roles/openshift-apps/koschei/templates/config-backend.cfg.j2 index 0f2dc2337d..d04408b5c5 100644 --- a/roles/openshift-apps/koschei/templates/config-backend.cfg.j2 +++ b/roles/openshift-apps/koschei/templates/config-backend.cfg.j2 @@ -159,7 +159,11 @@ config = { "backend": "dogpile.cache.memcached", "expiration_time": None, "arguments": { + {% if env == 'staging' %} + "url": "memcached02", + {% else %} "url": "memcached01", + {% endif %} }, }, }, diff --git a/roles/openshift-apps/koschei/templates/config-frontend.cfg.j2 b/roles/openshift-apps/koschei/templates/config-frontend.cfg.j2 index 3b112a8b7a..9a5419aad2 100644 --- a/roles/openshift-apps/koschei/templates/config-frontend.cfg.j2 +++ b/roles/openshift-apps/koschei/templates/config-frontend.cfg.j2 @@ -54,7 +54,11 @@ config = { "backend": "dogpile.cache.memcached", "expiration_time": 3600, # 1 hour "arguments": { + {% if env == 'staging' %} + "url": "memcached02:11211", + {% else %} "url": "memcached01:11211", + {% endif %} }, }, }, diff --git a/roles/packages3/web/templates/packages-app.ini.j2 b/roles/packages3/web/templates/packages-app.ini.j2 index f922ef4f9d..0441a32eda 100644 --- a/roles/packages3/web/templates/packages-app.ini.j2 +++ b/roles/packages3/web/templates/packages-app.ini.j2 @@ -43,7 +43,7 @@ git_repo_path = /var/cache/fedoracommunity/git.fedoraproject.org # and fill in the user info here. Never check this file into git with # this information filled in fedoracommunity.connector.fas.minimal_user_name={{ fcommFasUser }} -fedoracommunity.connector.fas.minimal_user_password={{ fcommFasPassword }} +fedoracommunity.connector.fas.minimal_user_password={{ fcommFasPassword }} # This is insecure, use only for testing fedora.clients.check_certs = True @@ -146,7 +146,11 @@ beaker.session.key = fedoracommunity beaker.session.secret = {{ fcommBeakerSessionSecret }} beaker.cache.type = ext:memcached +{% if env == 'staging' %} +beaker.cache.url = memcached02:11211 +{% else %} beaker.cache.url = memcached01:11211 +{% endif %} beaker.cache.lock_dir = /var/cache/fedoracommunity/beaker # If you'd like to fine-tune the individual locations of the cache data dirs