begin phasing in config of vpn via cdist

This commit is contained in:
Nico Schottelius 2020-12-20 12:20:54 +01:00
commit 054886fd9c
5 changed files with 122 additions and 42 deletions

View file

@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
import re
import ldap
from django.core.management.utils import get_random_secret_key
@ -199,14 +200,29 @@ AUTH_LDAP_USER_SEARCH = LDAPSearch("dc=example,dc=com",
# where to create customers
LDAP_CUSTOMER_DN="ou=customer,dc=example,dc=com"
CELERY_TASK_ROUTES = {
'*': {
'queue': 'vpn1'
}
}
def route_task(name, args, kwargs, options, task=None, **kw):
print(f"{name} - {args} - {kwargs}")
# if name == 'myapp.tasks.compress_video':
return {'queue': 'vpn1' }
# 'exchange_type': 'topic',
# 'routing_key': 'video.compress'}
CELERY_BROKER_URL = 'redis://bridge.place7.ungleich.ch:6379/0'
CELERY_RESULT_BACKEND = 'redis://bridge.place7.ungleich.ch:6379/0'
CELERY_TASK_ROUTES = (route_task,)
# CELERY_TASK_ROUTES = {
# '*': {
# 'queue': 'vpn1'
# }
# }
CELERY_BROKER_URL = 'redis://:uncloud.example.com:6379/0'
CELERY_RESULT_BACKEND = 'redis://:uncloud.example.com:6379/0'
CELERY_TASK_ROUTES = {
(re.compile(r'.*\.cdist\..*'), { 'queue': 'cdist' }
}
# CELERY_TASK_CREATE_MISSING_QUEUES = False