Commit 8245acfc by Feanil Patel

Begin using all caps variables for items that are meant to be externally configurable.

parent db09b9a7
---
notifier_user: "notifier"
notifier_web_user: "www-user"
notifier_home: "/opt/wwc/notifier"
notifier_venv_dir: "{{ notifier_home }}/virtualenvs/notifier"
notifier_db_dir: "{{ notifier_home }}/db"
notifier_source_repo: "git@github.com:edx/notifier.git"
notifier_code_dir: "{{ notifier_home }}/src"
notifier_version: "master"
notifier_git_identity_path: "{{ secure_dir }}/files/git-identity"
notifier_requirements_file: "{{ notifier_code_dir }}/requirements.txt"
notifier_log_level: "INFO"
notifier_rsyslog_enabled: "yes"
notifier_digest_task_interval: "1440"
NOTIFIER_USER: "notifier"
NOTIFIER_WEB_USER: "www-user"
NOTIFIER_HOME: "/opt/wwc/notifier"
NOTIFIER_VENV_DIR: "{{ NOTIFIER_HOME }}/virtualenvs/notifier"
NOTIFIER_DB_DIR: "{{ NOTIFIER_HOME }}/db"
NOTIFIER_SOURCE_REPO: "git@github.com:edx/notifier.git"
NOTIFIER_CODE_DIR: "{{ NOTIFIER_HOME }}/src"
NOTIFIER_VERSION: "master"
NOTIFIER_GIT_IDENTITY_PATH: "{{ secure_dir }}/files/git-identity"
NOTIFIER_REQUIREMENTS_FILE: "{{ NOTIFIER_CODE_DIR }}/requirements.txt"
NOTIFIER_LOG_LEVEL: "INFO"
NOTIFIER_RSYSLOG_ENABLED: "yes"
NOTIFIER_DIGEST_TASK_INTERVAL: "1440"
notifier_env: "Development"
NOTIFIER_ENV: "Development"
notifier_email_backend: "console"
notifier_email_host: "localhost"
notifier_email_port: 25
notifier_email_user: ""
notifier_email_pass: ""
notifier_email_use_tls: "False"
NOTIFIER_EMAIL_BACKEND: "console"
NOTIFIER_EMAIL_HOST: "localhost"
NOTIFIER_EMAIL_PORT: 25
NOTIFIER_EMAIL_USER: ""
NOTIFIER_EMAIL_PASS: ""
NOTIFIER_EMAIL_USE_TLS: "False"
notifier_email_domain: "notifications.edx.org"
notifier_email_rewrite_recipient: ""
NOTIFIER_EMAIL_DOMAIN: "notifications.edx.org"
NOTIFIER_EMAIL_REWRITE_RECIPIENT: ""
notifier_lms_url_base: "http://localhost:8000"
notifier_lms_secret_key: "PUT_YOUR_SECRET_KEY_HERE"
NOTIFIER_LMS_URL_BASE: "http://localhost:8000"
NOTIFIER_LMS_SECRET_KEY: "PUT_YOUR_SECRET_KEY_HERE"
notifier_comment_service_base: "http://localhost:4567"
notifier_comment_service_api_key: "PUT_YOUR_API_KEY_HERE"
NOTIFIER_COMMENT_SERVICE_BASE: "http://localhost:4567"
NOTIFIER_COMMENT_SERVICE_API_KEY: "PUT_YOUR_API_KEY_HERE"
notifier_user_service_base: "http://localhost:8000"
notifier_user_service_api_key: "PUT_YOUR_API_KEY_HERE"
notifier_user_service_http_auth_user: "guido"
notifier_user_service_http_auth_pass: "vanrossum"
notifier_celery_broker_url: "django://"
NOTIFIER_USER_SERVICE_BASE: "http://localhost:8000"
NOTIFIER_USER_SERVICE_API_KEY: "PUT_YOUR_API_KEY_HERE"
NOTIFIER_USER_SERVICE_HTTP_AUTH_USER: "guido"
NOTIFIER_USER_SERVICE_HTTP_AUTH_PASS: "vanrossum"
NOTIFIER_CELERY_BROKER_URL: "django://"
notifier_supervisor_log_dest: "/mnt/logs/supervisor"
NOTIFIER_SUPERVISOR_LOG_DEST: "/mnt/logs/supervisor"
notifer_requests_ca_bundle: "/etc/ssl/certs/ca-certificates.crt"
NOTIFER_REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
notifier_dd_api_key: "NOT_USED" # data dog
NOTIFIER_DD_API_KEY: "NOT_USED" # data dog
notifier_debian_pkgs:
- apparmor-utils
......@@ -62,27 +62,27 @@ notifier_debian_pkgs:
# the env variable for the supervisor job definition.
#
notifier_env_vars:
NOTIFIER_ENV: "{{ notifier_env }}"
NOTIFIER_DB_DIR: "{{ notifier_db_dir }}"
EMAIL_BACKEND: "{{ notifier_email_backend }}"
EMAIL_HOST: "{{ notifier_email_host }}"
EMAIL_PORT: "{{ notifier_email_port }}"
EMAIL_HOST_USER: "{{ notifier_email_user }}"
EMAIL_HOST_PASSWORD: "{{ notifier_email_pass }}"
EMAIL_USE_TLS: "{{ notifier_email_use_tls }}"
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 }}"
FORUM_DIGEST_TASK_INTERVAL: "{{ notifier_digest_task_interval }}"
NOTIFIER_ENV: $NOTIFIER_ENV
NOTIFIER_DB_DIR: $NOTIFIER_DB_DIR
EMAIL_BACKEND: $NOTIFIER_EMAIL_BACKEND
EMAIL_HOST: $NOTIFIER_EMAIL_HOST
EMAIL_PORT: $NOTIFIER_EMAIL_PORT
EMAIL_HOST_USER: $NOTIFIER_EMAIL_USER
EMAIL_HOST_PASSWORD: $NOTIFIER_EMAIL_PASS
EMAIL_USE_TLS: $NOTIFIER_EMAIL_USE_TLS
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
FORUM_DIGEST_TASK_INTERVAL: $NOTIFIER_DIGEST_TASK_INTERVAL
......@@ -9,8 +9,8 @@
- name: notifier | checkout code
git:
dest={{ notifier_code_dir }} repo={{ notifier_source_repo }}
version={{ notifier_version }}
dest={{ NOTIFIER_CODE_DIR }} repo={{ NOTIFIER_SOURCE_REPO }}
version={{ NOTIFIER_VERSION }}
notify:
- notifier | restart notifier
tags:
......@@ -21,7 +21,7 @@
- name: notifier | source repo group perms
file:
path={{ notifier_source_repo }} mode=2775 state=directory
path={{ NOTIFIER_SOURCE_REPO }} mode=2775 state=directory
tags:
- notifier
- deploy
......@@ -30,10 +30,10 @@
- name: notifier | install application requirements
pip:
requirements="{{ notifier_requirements_file }}"
virtualenv="{{ notifier_venv_dir }}" state=present
requirements="{{ NOTIFIER_REQUIREMENTS_FILE }}"
virtualenv="{{ NOTIFIER_VENV_DIR }}" state=present
sudo: true
sudo_user: "{{ notifier_user }}"
sudo_user: "{{ NOTIFIER_USER }}"
notify:
- notifier | restart notifier
tags:
......@@ -44,9 +44,9 @@
- name: notifier | syncdb
shell: >
cd {{ notifier_code_dir }} && {{ notifier_venv_dir }}/bin/python manage.py syncdb
cd {{ NOTIFIER_CODE_DIR }} && {{ NOTIFIER_VENV_DIR }}/bin/python manage.py syncdb
sudo: true
sudo_user: "{{ notifier_user }}"
sudo_user: "{{ NOTIFIER_USER }}"
notify:
- notifier | restart notifier
tags:
......
......@@ -71,10 +71,10 @@
- update
- ubuntu
- name: notifier | create notifier user {{ notifier_user }}
- name: notifier | create notifier user {{ NOTIFIER_USER }}
user:
name={{ notifier_user }} state=present shell=/bin/bash
home={{ notifier_home }} createhome=yes
name={{ NOTIFIER_USER }} state=present shell=/bin/bash
home={{ NOTIFIER_HOME }} createhome=yes
tags:
- notifier
- install
......@@ -82,8 +82,8 @@
- name: notifier | setup the notifier env
template:
src=notifier_env.j2 dest={{ notifier_home }}/notifier_env
owner="{{ notifier_user }}" group="{{ notifier_user }}"
src=notifier_env.j2 dest={{ NOTIFIER_HOME }}/notifier_env
owner="{{ NOTIFIER_USER }}" group="{{ NOTIFIER_USER }}"
tags:
- notifier
- install
......@@ -92,14 +92,14 @@
- name: notifier | drop a bash_profile
copy: >
src=../../common/files/bash_profile
dest={{ notifier_home }}/.bash_profile
owner={{ notifier_user }}
group={{ notifier_user }}
dest={{ NOTIFIER_HOME }}/.bash_profile
owner={{ NOTIFIER_USER }}
group={{ NOTIFIER_USER }}
- name: notifier | ensure .bashrc exists
shell: touch {{ notifier_home }}/.bashrc
shell: touch {{ NOTIFIER_HOME }}/.bashrc
sudo: true
sudo_user: "{{ notifier_user }}"
sudo_user: "{{ NOTIFIER_USER }}"
tags:
- notifier
- install
......@@ -107,9 +107,9 @@
- name: notifier | add source of notifier_env to .bashrc
lineinfile:
dest={{ notifier_home }}/.bashrc
regexp='. {{ notifier_home }}/notifier_env'
line='. {{ notifier_home }}/notifier_env'
dest={{ NOTIFIER_HOME }}/.bashrc
regexp='. {{ NOTIFIER_HOME }}/notifier_env'
line='. {{ NOTIFIER_HOME }}/notifier_env'
tags:
- notifier
- install
......@@ -117,9 +117,9 @@
- name: notifier | add source venv to .bashrc
lineinfile:
dest={{ notifier_home }}/.bashrc
regexp='. {{ notifier_venv_dir }}/bin/activate'
line='. {{ notifier_venv_dir }}/bin/activate'
dest={{ NOTIFIER_HOME }}/.bashrc
regexp='. {{ NOTIFIER_VENV_DIR }}/bin/activate'
line='. {{ NOTIFIER_VENV_DIR }}/bin/activate'
tags:
- notifier
- install
......@@ -127,7 +127,7 @@
- name: notifier | create notifier DB directory
file:
path="{{ notifier_db_dir }}" mode=2775 state=directory
path="{{ NOTIFIER_DB_DIR }}" mode=2775 state=directory
tags:
- notifier
- install
......@@ -135,7 +135,7 @@
- name: notifier | create notifier/bin directory
file:
path="{{ notifier_home }}/bin" mode=2775 state=directory
path="{{ NOTIFIER_HOME }}/bin" mode=2775 state=directory
tags:
- notifier
- install
......@@ -143,7 +143,7 @@
- name: common | create supervisor log directoy
file:
path={{notifier_supervisor_log_dest }} mode=2750 state=directory
path={{NOTIFIER_SUPERVISOR_LOG_DEST }} mode=2750 state=directory
tags:
- notifier
- install
......
......@@ -3,11 +3,11 @@
;
[program:notifier-scheduler]
command={{ notifier_venv_dir }}/bin/python manage.py scheduler
command={{ NOTIFIER_VENV_DIR }}/bin/python manage.py scheduler
process_name=%(program_name)s
numprocs=1
directory={{ notifier_code_dir }}
directory={{ NOTIFIER_CODE_DIR }}
umask=022
autostart=true
autorestart=true
......@@ -18,15 +18,15 @@ stopsignal=TERM
stopwaitsecs=10
user=notifier
redirect_stderr=false
stdout_logfile={{ notifier_supervisor_log_dest }}/notifier-scheduler-stdout.log
stdout_logfile={{ NOTIFIER_SUPERVISOR_LOG_DEST }}/notifier-scheduler-stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile={{notifier_supervisor_log_dest }}/notifier-scheduler-stderr.log
stderr_logfile={{ NOTIFIER_SUPERVISOR_LOG_DEST }}/notifier-scheduler-stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment=PID='/var/tmp/notifier-scheduler.pid',LANG=en_US.UTF-8,
{%- for name,value in notifier_env_vars.items() -%}
{%- for name,value in NOTIFIER_ENV_VARS.items() -%}
{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}
\ No newline at end of file
{%- endfor -%}
......@@ -3,11 +3,11 @@
;
[program:notifier-celery-workers]
command={{ notifier_venv_dir }}/bin/python manage.py celery worker -l {{ notifier_log_level }}
command={{ NOTIFIER_VENV_DIR }}/bin/python manage.py celery worker -l {{ NOTIFIER_LOG_LEVEL }}
process_name=%(program_name)s
numprocs=1
directory={{ notifier_code_dir }}
directory={{ NOTIFIER_CODE_DIR }}
umask=022
autostart=true
autorestart=true
......@@ -18,15 +18,15 @@ stopsignal=TERM
stopwaitsecs=10
user=notifier
redirect_stderr=false
stdout_logfile={{notifier_supervisor_log_dest }}/notifier-celery-workers-stdout.log
stdout_logfile={{NOTIFIER_SUPERVISOR_LOG_DEST }}/notifier-celery-workers-stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile={{notifier_supervisor_log_dest }}/notifier-celery-workers-stderr.log
stderr_logfile={{ NOTIFIER_SUPERVISOR_LOG_DEST }}/notifier-celery-workers-stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment=PID='/var/tmp/notifier-celery-workers.pid',LANG=en_US.UTF-8,
{%- for name,value in notifier_env_vars.items() -%}
{%- for name,value in NOTIFIER_ENV_VARS.items() -%}
{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}
\ No newline at end of file
{%- endfor -%}
......@@ -3,11 +3,11 @@
;
[program:notifier-scheduler]
command={{ notifier_venv_dir }}/bin/python manage.py scheduler
command={{ NOTIFIER_VENV_DIR }}/bin/python manage.py scheduler
process_name=%(program_name)s
numprocs=1
directory={{ notifier_code_dir }}
directory={{ NOTIFIER_CODE_DIR }}
umask=022
autostart=true
autorestart=true
......@@ -18,15 +18,15 @@ stopsignal=TERM
stopwaitsecs=10
user=notifier
redirect_stderr=false
stdout_logfile={{ notifier_supervisor_log_dest }}/notifier-scheduler-stdout.log
stdout_logfile={{ NOTIFIER_SUPERVISOR_LOG_DEST }}/notifier-scheduler-stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile={{notifier_supervisor_log_dest }}/notifier-scheduler-stderr.log
stderr_logfile={{ NOTIFIER_SUPERVISOR_LOG_DEST }}/notifier-scheduler-stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment=PID='/var/tmp/notifier-scheduler.pid',LANG=en_US.UTF-8,
{%- for name,value in notifier_env_vars.items() -%}
{%- for name,value in NOTIFIER_ENV_VARS.items() -%}
{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}
\ No newline at end of file
{%- endfor -%}
# {{ ansible_managed }}
{% for name,value in notifier_env_vars.items() %}
{% for name,value in NOTIFIER_ENV_VARS.items() %}
{% if value %}
export {{ name }}="{{ value }}"
{% endif %}
{% endfor %}
\ No newline at end of file
{% endfor %}
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