diff --git a/defaults/main.yml b/defaults/main.yml index 263e99e..3574f89 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -48,7 +48,7 @@ kpi_python_version: "python2.7" kpi_checkout_path: "{{ kpi_versioned_path }}/{{ kpi_git_branch }}" kpi_app_path: "{{ kpi_system_user_home }}/app" kpi_versioned_path: "{{ kpi_app_path }}-versioned" -kpi_git_branch: master +kpi_git_branch: ona-custom-changes kpi_service_name: "{{ kpi_system_user }}" kpi_venv_path: "{{ kpi_system_user_home }}/.virtualenvs/{{ kpi_service_name }}" kpi_nvm_install_path: "{{ kpi_system_user_home }}/.nvm" @@ -102,12 +102,14 @@ kpi_collectd_scripts: - unixsock kpi_monit_scripts: - uwsgi -kpi_celery_app: "kpi.kpi_celery:app" +kpi_celery_app: "kobo" +kpi_celeryd_opts: "--exclude-queues=sync_kobocat_xforms_queue" kpi_django_pip_packages: - uwsgi - PyJWT==1.4.0 -kpi_django_enable_celery: false +kpi_django_enable_celery: true +kpi_django_manage_services: true kpi_uwsgi_total_memory_limit: 1024 kpi_raven_dsn: "" diff --git a/handlers/main.yml b/handlers/main.yml index bb2e5e4..73b314f 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,6 +1 @@ ---- -- name: restart_service - service: - name: "{{ kpi_service_name }}" - state: restarted - enabled: true +--- \ No newline at end of file diff --git a/meta/main.yml b/meta/main.yml index fcb2dcf..10233d4 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -43,10 +43,10 @@ dependencies: django_wsgi_env: "{{ kpi_wsgi_env }}" django_wsgi_enable_threads: "{{ kpi_wsgi_enable_threads }}" django_celery_app: "{{ kpi_celery_app }}" + django_celeryd_opts: "{{ kpi_celeryd_opts }}" django_apt_python_ppa: "{{ kpi_django_apt_python_ppa }}" django_pip_paths: "{{ kpi_pip_paths }}" django_pip_packages: "{{ kpi_django_pip_packages }}" - django_enable_celery: "{{ kpi_django_enable_celery }}" django_venv_path: "{{ kpi_venv_path }}" django_pid_socks_dir: "{{ kpi_pid_socket_dir }}" django_pid_file: "{{ kpi_pid_file }}" @@ -54,6 +54,7 @@ dependencies: django_service_group: "{{ kpi_service_group }}" django_wsgi_group: "{{ kpi_wsgi_group }}" django_python_packages: "{{ kpi_python_packages }}" + django_manage_services: "{{ kpi_django_manage_services }}" - role: onaio.collectd collectd_scripts: "{{ kpi_collectd_scripts }}" diff --git a/molecule/default/tests/vagranttest.yml b/molecule/default/tests/vagranttest.yml index 23db45c..b79eca3 100644 --- a/molecule/default/tests/vagranttest.yml +++ b/molecule/default/tests/vagranttest.yml @@ -57,16 +57,20 @@ django_apt_python_ppa: "{{ kpi_django_apt_python_ppa }}" django_pip_paths: "{{ kpi_pip_paths }}" django_pip_packages: "{{ kpi_django_pip_packages }}" - django_enable_celery: "{{ kpi_django_enable_celery }}" django_venv_path: "{{ kpi_venv_path }}" django_pid_socks_dir: "{{ kpi_pid_socket_dir }}" django_pid_file: "{{ kpi_pid_file }}" django_wsgi_socket: "{{ kpi_socket_file }}" django_service_group: "{{ kpi_service_group }}" django_wsgi_group: "{{ kpi_wsgi_group }}" + django_celeryd_opts: "{{ kpi_celeryd_opts }}" + django_manage_services: "{{ kpi_django_manage_services }}" + gather_facts: true become: true roles: - name: "kpi" - role: ../.. + role: ../../../.. + vars: + kpi_enable_monitoring: false \ No newline at end of file diff --git a/templates/kpi/settings.py.j2 b/templates/kpi/settings.py.j2 index 33f5fd7..a3f3768 100644 --- a/templates/kpi/settings.py.j2 +++ b/templates/kpi/settings.py.j2 @@ -463,7 +463,7 @@ ENKETO_SURVEY_ENDPOINT = 'api/v2/survey/all' CELERY_TIMEZONE = "UTC" -CELERY_TASK_ALWAYS_EAGER = True +CELERY_TASK_ALWAYS_EAGER = False # if os.environ.get('SKIP_CELERY', 'False') == 'True': # # helpful for certain debugging # CELERY_TASK_ALWAYS_EAGER = True @@ -496,7 +496,7 @@ CELERY_BROKER_TRANSPORT_OPTIONS = { "visibility_timeout": 60 * (10 ** 3) # Longest ETA for RestService } -CELERY_TASK_DEFAULT_QUEUE = "kpi_queue" +CELERY_DEFAULT_QUEUE = "kpi_queue" if 'KOBOCAT_URL' in os.environ: SYNC_KOBOCAT_XFORMS = (os.environ.get('SYNC_KOBOCAT_XFORMS', 'True') == 'True') @@ -521,7 +521,7 @@ RabbitMQ queue creation: rabbitmqctl set_permissions -p kpi kpi '.*' '.*' '.*' See http://celery.readthedocs.org/en/latest/getting-started/brokers/rabbitmq.html#setting-up-rabbitmq. ''' -CELERY_BROKER_URL = os.environ.get('KPI_BROKER_URL', 'redis://localhost:6379/1') +BROKER_URL = os.environ.get('KPI_BROKER_URL', '{{ kpi_broker_url }}') # http://django-registration-redux.readthedocs.org/en/latest/quickstart.html#settings ACCOUNT_ACTIVATION_DAYS = 3