Commit ae0c8134 by Jason Bau

notifier fixes

parent 951182dc
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
- datadog - datadog
#- splunkforwarder #- splunkforwarder
# run the certificate agent on the first util machine only - name: run the certificate agent on the first util machine only
- hosts: ~tag_Name_util1_prod hosts: ~tag_Name_util1_prod
sudo: True sudo: True
vars: vars:
secure_dir: '../../../configuration-secure/ansible' secure_dir: '../../../configuration-secure/ansible'
...@@ -63,25 +63,20 @@ ...@@ -63,25 +63,20 @@
- "{{ secure_dir }}/vars/edxapp_prod_vars.yml" - "{{ secure_dir }}/vars/edxapp_prod_vars.yml"
- "{{ secure_dir }}/vars/certs_prod_vars.yml" - "{{ secure_dir }}/vars/certs_prod_vars.yml"
roles: roles:
- role: gh_users # gh_users var intentionally unspecified
tags: users
- role: certs - role: certs
tags: certs tags: certs
# run the notifier on the first util machine only - name: run the notifier on the second util machine only
#- hosts: ~tag_Name_util1_prod hosts: ~tag_Name_util2_prod
# sudo: True sudo: True
# vars: vars:
# secure_dir: '../../../configuration-secure/ansible' secure_dir: "../../../configuration-secure/ansible"
# migrate_db: "no" local_dir: "{{secure_dir}}/local"
# vars_files: migrate_db: "no"
# - "roles/common/defaults/main.yml" vars_files:
# - "roles/supervisor/defaults/main.yml" - "roles/common/defaults/main.yml"
# - "{{ secure_dir }}/vars/edxapp_prod_vars.yml" - "roles/supervisor/defaults/main.yml"
# - "{{ secure_dir }}/vars/notifier_prod_vars.yml" - "{{ secure_dir }}/vars/notifier_prod_vars.yml"
# roles: roles:
# - role: virtualenv - role: notifier
# virtualenv_user: "notifier" tags: notifier
# virtualenv_user_home: "/opt/wwc/notifier"
# virtualenv_name: "notifier"
# - notifier
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
- name: apache | Register the fact that apache role has run - name: apache | Register the fact that apache role has run
command: echo True command: echo True
register: apache_role_run register: apache_role_run
notify: apache | restart apache
tags: tags:
- apache - apache
- install - install
......
--- ---
NOTIFIER_USER: "notifier" NOTIFIER_USER: "notifier"
NOTIFIER_WEB_USER: "www-user" NOTIFIER_WEB_USER: "www-data"
NOTIFIER_HOME: "{{ COMMON_APP_DIR }}/notifier" NOTIFIER_HOME: "{{ COMMON_APP_DIR }}/notifier"
NOTIFIER_VENV_DIR: "{{ NOTIFIER_HOME }}/virtualenvs/notifier" NOTIFIER_VENV_DIR: "{{ NOTIFIER_HOME }}/virtualenvs/notifier"
NOTIFIER_DB_DIR: "{{ NOTIFIER_HOME }}/db" NOTIFIER_DB_DIR: "{{ NOTIFIER_HOME }}/db"
...@@ -26,6 +26,12 @@ NOTIFIER_EMAIL_USE_TLS: "False" ...@@ -26,6 +26,12 @@ NOTIFIER_EMAIL_USE_TLS: "False"
NOTIFIER_EMAIL_DOMAIN: "notifications.edx.org" NOTIFIER_EMAIL_DOMAIN: "notifications.edx.org"
NOTIFIER_EMAIL_REWRITE_RECIPIENT: "" NOTIFIER_EMAIL_REWRITE_RECIPIENT: ""
NOTIFIER_FORUM_DIGEST_EMAIL_SENDER: "notifications@example.org"
NOTIFIER_FORUM_DIGEST_EMAIL_SUBJECT: "Daily Discussion Digest"
NOTIFIER_FORUM_DIGEST_EMAIL_TITLE: "Discussion Digest"
NOTIFIER_FORUM_DIGEST_EMAIL_DESCRIPTION: "A digest of unread content from course discussions you are following."
NOTIFIER_EMAIL_SENDER_POSTAL_ADDRESS: "Cambridge, MA"
NOTIFIER_LMS_URL_BASE: "http://localhost:8000" 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"
...@@ -37,7 +43,7 @@ NOTIFIER_USER_SERVICE_API_KEY: "PUT_YOUR_API_KEY_HERE" ...@@ -37,7 +43,7 @@ NOTIFIER_USER_SERVICE_API_KEY: "PUT_YOUR_API_KEY_HERE"
NOTIFIER_USER_SERVICE_HTTP_AUTH_USER: "guido" 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://"
NOTIFIER_LOGO_IMAGE_URL: "{{ NOTIFIER_LMS_URL_BASE }}/static/images/header-logo.png"
NOTIFIER_SUPERVISOR_LOG_DEST: "{{ COMMON_DATA_DIR }}/log/supervisor" NOTIFIER_SUPERVISOR_LOG_DEST: "{{ COMMON_DATA_DIR }}/log/supervisor"
NOTIFER_REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt" NOTIFER_REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
...@@ -85,3 +91,9 @@ notifier_env_vars: ...@@ -85,3 +91,9 @@ notifier_env_vars:
US_HTTP_AUTH_USER: $NOTIFIER_USER_SERVICE_HTTP_AUTH_USER US_HTTP_AUTH_USER: $NOTIFIER_USER_SERVICE_HTTP_AUTH_USER
US_HTTP_AUTH_PASS: $NOTIFIER_USER_SERVICE_HTTP_AUTH_PASS US_HTTP_AUTH_PASS: $NOTIFIER_USER_SERVICE_HTTP_AUTH_PASS
FORUM_DIGEST_TASK_INTERVAL: $NOTIFIER_DIGEST_TASK_INTERVAL FORUM_DIGEST_TASK_INTERVAL: $NOTIFIER_DIGEST_TASK_INTERVAL
LOGO_IMAGE_URL: $NOTIFIER_LOGO_IMAGE_URL
FORUM_DIGEST_EMAIL_SENDER: $NOTIFIER_FORUM_DIGEST_EMAIL_SENDER
FORUM_DIGEST_EMAIL_SUBJECT: $NOTIFIER_FORUM_DIGEST_EMAIL_SUBJECT
FORUM_DIGEST_EMAIL_TITLE: $NOTIFIER_FORUM_DIGEST_EMAIL_TITLE
FORUM_DIGEST_EMAIL_DESCRIPTION: $NOTIFIER_FORUM_DIGEST_EMAIL_TITLE
EMAIL_SENDER_POSTAL_ADDRESS: $NOTIFIER_FORUM_DIGEST_EMAIL_TITLE
...@@ -40,3 +40,13 @@ ...@@ -40,3 +40,13 @@
- notifier | restart notifier-celery-workers - notifier | restart notifier-celery-workers
tags: tags:
- deploy - deploy
- name: notifier | fix permissions on notifer db file
shell: >
chmod 0664 {{ NOTIFIER_DB_DIR }}/*
sudo: true
notify:
- notifier | restart notifier-scheduler
- notifier | restart notifier-celery-workers
tags:
- deploy
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
user: user:
name={{ NOTIFIER_USER }} state=present shell=/bin/bash name={{ NOTIFIER_USER }} state=present shell=/bin/bash
home={{ NOTIFIER_HOME }} createhome=yes home={{ NOTIFIER_HOME }} createhome=yes
ignore_errors: true
- name: notifier | setup the notifier env - name: notifier | setup the notifier env
template: template:
...@@ -79,11 +80,11 @@ ...@@ -79,11 +80,11 @@
- name: notifier | create notifier DB directory - name: notifier | create notifier DB directory
file: file:
path="{{ NOTIFIER_DB_DIR }}" mode=2775 state=directory path="{{ NOTIFIER_DB_DIR }}" mode=2775 state=directory owner={{ NOTIFIER_USER }} group={{ NOTIFIER_WEB_USER }}
- name: notifier | create notifier/bin directory - name: notifier | create notifier/bin directory
file: file:
path="{{ NOTIFIER_HOME }}/bin" mode=2775 state=directory path="{{ NOTIFIER_HOME }}/bin" mode=2775 state=directory owner={{ NOTIFIER_USER }} group={{ NOTIFIER_WEB_USER }}
- name: notifier | supervisord config for celery workers - name: notifier | supervisord config for celery workers
template: > template: >
......
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