Commit 7863c1c3 by Xavier Antoviaque

notifier-env-extra: Allow to add extra variables to notifier environment

parent d11a9f42
...@@ -19,6 +19,8 @@ NOTIFIER_DIGEST_EMAIL_TITLE: "Discussion Digest" ...@@ -19,6 +19,8 @@ NOTIFIER_DIGEST_EMAIL_TITLE: "Discussion Digest"
NOTIFIER_DIGEST_EMAIL_DESCRIPTION: "A digest of unread content from course discussions you are following." NOTIFIER_DIGEST_EMAIL_DESCRIPTION: "A digest of unread content from course discussions you are following."
NOTIFIER_EMAIL_SENDER_POSTAL_ADDRESS: "" NOTIFIER_EMAIL_SENDER_POSTAL_ADDRESS: ""
NOTIFIER_ENV_EXTRA: {}
NOTIFIER_LANGUAGE: "" NOTIFIER_LANGUAGE: ""
NOTIFIER_ENV: "Development" NOTIFIER_ENV: "Development"
......
...@@ -26,6 +26,7 @@ stderr_logfile_maxbytes=1MB ...@@ -26,6 +26,7 @@ stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10 stderr_logfile_backups=10
stderr_capture_maxbytes=1MB stderr_capture_maxbytes=1MB
environment=PID='/var/tmp/notifier-celery-workers.pid',LANG=en_US.UTF-8, environment=PID='/var/tmp/notifier-celery-workers.pid',LANG=en_US.UTF-8,
{% do notifier_env_vars.update(NOTIFIER_ENV_EXTRA) %}
{%- for name,value in notifier_env_vars.items() -%} {%- for name,value in notifier_env_vars.items() -%}
{%- if value -%}{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}{%- endif -%} {%- if value -%}{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}{%- endif -%}
{%- endfor -%} {%- endfor -%}
...@@ -26,6 +26,7 @@ stderr_logfile_maxbytes=1MB ...@@ -26,6 +26,7 @@ stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10 stderr_logfile_backups=10
stderr_capture_maxbytes=1MB stderr_capture_maxbytes=1MB
environment=PID='/var/tmp/notifier-scheduler.pid',LANG=en_US.UTF-8, environment=PID='/var/tmp/notifier-scheduler.pid',LANG=en_US.UTF-8,
{% do notifier_env_vars.update(NOTIFIER_ENV_EXTRA) %}
{%- for name,value in notifier_env_vars.items() -%} {%- for name,value in notifier_env_vars.items() -%}
{%- if value -%}{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}{%- endif -%} {%- if value -%}{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}{%- endif -%}
{%- endfor -%} {%- endfor -%}
# {{ ansible_managed }} # {{ ansible_managed }}
{% do notifier_env_vars.update(NOTIFIER_ENV_EXTRA) %}
{% for name,value in notifier_env_vars.items() %} {% for name,value in notifier_env_vars.items() %}
{% if value %} {% if value %}
export {{ name }}="{{ value }}" export {{ name }}="{{ value }}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment