Commit aeb951c0 by Max Rothman

Refactor NOTIFIER_HOME to notifier_app_dir

parent ee1fbca6
- Role: notifier
- Refactored NOTIFIER_HOME to notifier_app_dir to match other roles. This shouldn't change anything since you should've only been overriding COMMON_HOME.
- Role: gitreload
- New role added for running
[gitreload](https://github.com/mitodl/gitreload) that can be used
......
---
NOTIFIER_USER: "notifier"
NOTIFIER_WEB_USER: "www-data"
NOTIFIER_HOME: "{{ COMMON_APP_DIR }}/notifier"
NOTIFIER_VENV_DIR: "{{ NOTIFIER_HOME }}/virtualenvs/notifier"
NOTIFIER_DB_DIR: "{{ NOTIFIER_HOME }}/db"
NOTIFIER_VENV_DIR: "{{ notifier_app_dir }}/virtualenvs/notifier"
NOTIFIER_DB_DIR: "{{ notifier_app_dir }}/db"
NOTIFIER_SOURCE_REPO: "https://github.com/edx/notifier.git"
NOTIFIER_CODE_DIR: "{{ NOTIFIER_HOME }}/src"
NOTIFIER_CODE_DIR: "{{ notifier_app_dir }}/src"
NOTIFIER_VERSION: "master"
NOTIFIER_REQUIREMENTS_FILE: "{{ NOTIFIER_CODE_DIR }}/requirements.txt"
NOTIFIER_LOG_LEVEL: "INFO"
......@@ -20,7 +18,7 @@ NOTIFIER_THEME_REPO: ""
NOTIFIER_THEME_VERSION: "master"
notifier_git_ssh: "/tmp/notifier_git_ssh.sh"
NOTIFIER_GIT_IDENTITY: ""
notifier_git_identity: "{{ NOTIFIER_HOME }}/notifier-git-identity"
notifier_git_identity: "{{ notifier_app_dir }}/notifier-git-identity"
NOTIFIER_DIGEST_EMAIL_SENDER: "notifications@example.com"
NOTIFIER_DIGEST_EMAIL_SUBJECT: "Daily Discussion Digest"
......@@ -61,6 +59,9 @@ NOTIFER_REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
NOTIFIER_DD_API_KEY: "NOT_USED" # data dog
notifier_app_dir: "{{ COMMON_APP_DIR }}/notifier"
notifier_debian_pkgs:
- apparmor-utils
- build-essential
......
......@@ -56,31 +56,31 @@
- name: setup the notifier env
template:
src=notifier_env.j2 dest={{ NOTIFIER_HOME }}/notifier_env
src=notifier_env.j2 dest={{ notifier_app_dir }}/notifier_env
owner="{{ NOTIFIER_USER }}" group="{{ NOTIFIER_USER }}"
mode=655
- name: drop a bash_profile
copy: >
src=../../common/files/bash_profile
dest={{ NOTIFIER_HOME }}/.bash_profile
dest={{ notifier_app_dir }}/.bash_profile
owner={{ NOTIFIER_USER }}
group={{ NOTIFIER_USER }}
- name: ensure .bashrc exists
shell: touch {{ NOTIFIER_HOME }}/.bashrc
shell: touch {{ notifier_app_dir }}/.bashrc
sudo: true
sudo_user: "{{ NOTIFIER_USER }}"
- name: add source of notifier_env to .bashrc
lineinfile:
dest={{ NOTIFIER_HOME }}/.bashrc
regexp='. {{ NOTIFIER_HOME }}/notifier_env'
line='. {{ NOTIFIER_HOME }}/notifier_env'
dest={{ notifier_app_dir }}/.bashrc
regexp='. {{ notifier_app_dir }}/notifier_env'
line='. {{ notifier_app_dir }}/notifier_env'
- name: add source venv to .bashrc
lineinfile:
dest={{ NOTIFIER_HOME }}/.bashrc
dest={{ notifier_app_dir }}/.bashrc
regexp='. {{ NOTIFIER_VENV_DIR }}/bin/activate'
line='. {{ NOTIFIER_VENV_DIR }}/bin/activate'
......@@ -90,11 +90,11 @@
- name: create notifier/bin directory
file:
path="{{ NOTIFIER_HOME }}/bin" mode=2775 state=directory owner={{ NOTIFIER_USER }} group={{ NOTIFIER_USER }}
path="{{ notifier_app_dir }}/bin" mode=2775 state=directory owner={{ NOTIFIER_USER }} group={{ NOTIFIER_USER }}
- name: create notifier/.ssh directory
file:
path="{{ NOTIFIER_HOME }}/.ssh" mode=2700 state=directory owner={{ NOTIFIER_USER }} group={{ NOTIFIER_USER }}
path="{{ notifier_app_dir }}/.ssh" mode=2700 state=directory owner={{ NOTIFIER_USER }} group={{ NOTIFIER_USER }}
- name: create service log dir
file: >
......@@ -104,18 +104,18 @@
group="syslog"
with_items:
- "{{ COMMON_LOG_DIR }}/notifier"
- name: write supervisord wrapper for celery workers
template: >
src=notifier-celery-workers-supervisor.sh.j2
dest="{{ NOTIFIER_HOME }}/notifier-celery-workers-supervisor.sh"
dest="{{ notifier_app_dir }}/notifier-celery-workers-supervisor.sh"
mode=0775
sudo_user: "{{ NOTIFIER_USER }}"
- name: write supervisord wrapper for scheduler
template: >
src=notifier-scheduler-supervisor.sh.j2
dest="{{ NOTIFIER_HOME }}/notifier-scheduler-supervisor.sh"
dest="{{ notifier_app_dir }}/notifier-scheduler-supervisor.sh"
mode=0775
sudo_user: "{{ NOTIFIER_USER }}"
......
......@@ -3,7 +3,7 @@
;
[program:notifier-celery-workers]
command={{ NOTIFIER_HOME }}/notifier-celery-workers-supervisor.sh
command={{ notifier_app_dir }}/notifier-celery-workers-supervisor.sh
process_name=%(program_name)s
numprocs=1
......
......@@ -3,7 +3,7 @@
;
[program:notifier-scheduler]
command={{ NOTIFIER_HOME }}/notifier-scheduler-supervisor.sh
command={{ notifier_app_dir }}/notifier-scheduler-supervisor.sh
process_name=%(program_name)s
numprocs=1
......
#!/bin/bash
source {{ NOTIFIER_HOME }}/notifier_env
source {{ notifier_app_dir }}/notifier_env
cd {{ NOTIFIER_CODE_DIR }}
export PID='/var/tmp/notifier-scheduler.pid'
......
#!/bin/bash
source {{ NOTIFIER_HOME }}/notifier_env
source {{ notifier_app_dir }}/notifier_env
cd {{ NOTIFIER_CODE_DIR }}
export PID='/var/tmp/notifier-celery-workers.pid'
......
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