Commit ac2b3668 by e0d

Builds the env definition via iteration.

parent 5d70d116
# Application Environment # {{ ansible_managed }}
export NOTIFIER_ENV="{{ notifier_env }}"
# email settings independent of transport {% for name,value in notifier_env_vars.items() %}
export EMAIL_BACKEND="{{ notifier_email_backend }}" {% if value %}
export EMAIL_HOST="{{ notifier_email_host }}" export {{ name }}="{{ value }}"
export EMAIL_PORT="{{ notifer_email_port }}" {% endif %}
export EMAIL_HOST_USER="{{ notifer_email_user }}" {% endfor %}
export EMAIL_HOST_PASSWORD="{{ notifier_email_pass }}" \ No newline at end of file
export EMAIL_DOMAIN="{{ notifier_email_domain }}"
export EMAIL_REWRITE_RECIPIENT="{{ notifer_email_rewrite_recipient }}"
# LMS links, images, etc
export LMS_URL_BASE="{{ notifier_lms_url_base }}"
export SECRET_KEY="{{ notifier_lms_secret_key }}"
# Comments Service Endpoint, for digest pulls
export CS_URL_BASE="{{ notifier_comment_service_base }}"
export CS_API_KEY="{{ notifier_comment_service_api_key }}"
# User Service Endpoint, for notification prefs
export US_URL_BASE="{{ notifier_user_service_base }}"
export US_API_KEY="{{ notifier_user_service_api_key }}"
# celery
export BROKER_URL="{{ notifier_celery_broker_url }}"
# have requests use the OS ca certs
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
# basic auth credentils
export US_HTTP_AUTH_USER="{{ notifier_user_service_http_auth_user }}"
export US_HTTP_AUTH_PASS="{{ notifier_user_service_http_auth_pass }}"
...@@ -7,8 +7,11 @@ notifier_venv_dir: "{{ notifier_home }}/virtualenvs/notifier" ...@@ -7,8 +7,11 @@ notifier_venv_dir: "{{ notifier_home }}/virtualenvs/notifier"
notifier_source_repo: "git@github.com:edx/notifier.git" notifier_source_repo: "git@github.com:edx/notifier.git"
notifier_code_dir: "{{ notifier_home }}/src" notifier_code_dir: "{{ notifier_home }}/src"
notifier_version: "rc/digests" notifier_version: "rc/digests"
#notifier_version: "d98ad359c1e61cabc7ded3c81b03c5dc01dddd71"
notifier_git_identity_path: "{{ secure_dir }}/files/git-identity" notifier_git_identity_path: "{{ secure_dir }}/files/git-identity"
notifier_requirements_file: "{{ notifier_code_dir }}/requirements.txt" notifier_requirements_file: "{{ notifier_code_dir }}/requirements.txt"
notifier_log_level: "INFO"
notifier_rsyslog_enabled: "yes"
notifier_env: "Development" notifier_env: "Development"
...@@ -27,7 +30,7 @@ notifier_lms_url_base: "http://localhost:8000" ...@@ -27,7 +30,7 @@ notifier_lms_url_base: "http://localhost:8000"
notifier_lms_secret_key: "PUT_YOUR_SECRET_KEY_HERE" notifier_lms_secret_key: "PUT_YOUR_SECRET_KEY_HERE"
notifier_comment_service_base: "http://localhost:4567" notifier_comment_service_base: "http://localhost:4567"
2notifier_comment_service_api_key: "PUT_YOUR_API_KEY_HERE" notifier_comment_service_api_key: "PUT_YOUR_API_KEY_HERE"
notifier_user_service_base: "http://localhost:8000" notifier_user_service_base: "http://localhost:8000"
notifier_user_service_api_key: "PUT_YOUR_API_KEY_HERE" notifier_user_service_api_key: "PUT_YOUR_API_KEY_HERE"
...@@ -35,6 +38,8 @@ notifier_user_service_http_auth_user: "guido" ...@@ -35,6 +38,8 @@ notifier_user_service_http_auth_user: "guido"
notifier_user_service_http_auth_pass: "vanrossum" notifier_user_service_http_auth_pass: "vanrossum"
notifier_celery_broker_url: "django://" notifier_celery_broker_url: "django://"
notifer_requests_ca_bundle: "/etc/ssl/certs/ca-certificates.crt"
notifier_debian_pkgs: notifier_debian_pkgs:
- apparmor-utils - apparmor-utils
- build-essential - build-essential
...@@ -43,4 +48,30 @@ notifier_debian_pkgs: ...@@ -43,4 +48,30 @@ notifier_debian_pkgs:
- gcc - gcc
- ipython - ipython
- pkg-config - pkg-config
- rsyslog - rsyslog
\ No newline at end of file - supervisor
#
# This structure is iterated over in order to build both
# the environment file for the notifier which is sourced
# into the applications's environment and for building
# the env variable for the supervisor job definition.
#
notifier_env_vars:
NOTIFIER_ENV: "{{ notifier_env }}"
EMAIL_BACKEND: "{{ notifier_email_backend }}"
EMAIL_DOMAIN: "{{ notifier_email_domain }}"
EMAIL_REWRITE_RECIPIENT: "{{ notifier_email_rewrite_recipient }}"
LMS_URL_BASE: "{{ notifier_lms_url_base }}"
SECRET_KEY: "{{ notifier_lms_secret_key }}"
CS_URL_BASE: "{{ notifier_comment_service_base }}"
CS_API_KEY: "{{ notifier_comment_service_api_key }}"
US_URL_BASE: "{{ notifier_user_service_base }}"
US_API_KEY: "{{ notifier_user_service_api_key }}"
DATADOG_API_KEY: "{{ notifier_dd_api_key }}"
LOG_LEVEL: "{{ notifier_log_level }}"
RSYSLOG_ENABLED: "{{ notifier_rsyslog_enabled }}"
BROKER_URL: "{{ notifier_celery_broker_url }}"
REQUESTS_CA_BUNDLE: "{{ notifer_requests_ca_bundle }}"
US_HTTP_AUTH_USER: "{{ notifier_user_service_http_auth_user }}"
US_HTTP_AUTH_PASS: "{{ notifier_user_service_http_auth_pass }}"
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