Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
d9227fc4
Commit
d9227fc4
authored
Nov 08, 2013
by
e0d
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #425 from edx/e0d/notifier-refactor
E0d/notifier refactor
parents
2b385bb7
2b936b5d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
87 deletions
+32
-87
playbooks/roles/notifier/defaults/main.yml
+2
-3
playbooks/roles/notifier/handlers/main.yml
+10
-18
playbooks/roles/notifier/tasks/deploy.yml
+10
-23
playbooks/roles/notifier/tasks/main.yml
+10
-9
playbooks/roles/notifier/templates/edx/app/supervisor/conf.d/notifier-celery-workers.conf.j2
+0
-1
playbooks/roles/notifier/templates/edx/app/supervisor/conf.d/notifier-scheduler.conf.j2
+0
-1
playbooks/roles/notifier/templates/etc/supervisor/conf.d/notifier-scheduler.conf.j2
+0
-32
No files found.
playbooks/roles/notifier/defaults/main.yml
View file @
d9227fc4
...
...
@@ -2,7 +2,7 @@
NOTIFIER_USER
:
"
notifier"
NOTIFIER_WEB_USER
:
"
www-user"
NOTIFIER_HOME
:
"
/opt/wwc
/notifier"
NOTIFIER_HOME
:
"
{{
COMMON_APP_DIR
}}
/notifier"
NOTIFIER_VENV_DIR
:
"
{{
NOTIFIER_HOME
}}/virtualenvs/notifier"
NOTIFIER_DB_DIR
:
"
{{
NOTIFIER_HOME
}}/db"
NOTIFIER_SOURCE_REPO
:
"
https://github.com/edx/notifier.git"
...
...
@@ -38,7 +38,7 @@ NOTIFIER_USER_SERVICE_HTTP_AUTH_USER: "guido"
NOTIFIER_USER_SERVICE_HTTP_AUTH_PASS
:
"
vanrossum"
NOTIFIER_CELERY_BROKER_URL
:
"
django://"
NOTIFIER_SUPERVISOR_LOG_DEST
:
"
{{
COMMON_DATA_DIR
}}/log
s
/supervisor"
NOTIFIER_SUPERVISOR_LOG_DEST
:
"
{{
COMMON_DATA_DIR
}}/log/supervisor"
NOTIFER_REQUESTS_CA_BUNDLE
:
"
/etc/ssl/certs/ca-certificates.crt"
...
...
@@ -53,7 +53,6 @@ notifier_debian_pkgs:
-
ipython
-
pkg-config
-
rsyslog
-
supervisor
#
# This structure is iterated over in order to build both
...
...
playbooks/roles/notifier/handlers/main.yml
View file @
d9227fc4
---
##
## for future compliance, when the API comes on line.
##
-
name
:
notifier | install notifier-scheduler
supervisorctl
:
name=notifier-scheduler state=present
-
name
:
notifier | install notifier-celery-workers
supervisorctl
:
name=notifier-celery-workers state=present
-
name
:
notifier | restart notifier
supervisorctl
:
name=notifier-scheduler state=restarted
notify
:
-
notifier | install notifier-celery-workers
-
notifier | install notifier-scheduler
-
name
:
notifier | restart notifier-scheduler
supervisorctl
:
name=notifier-scheduler state=restarted
supervisorctl
:
>
name=notifier-scheduler
state=restarted
config={{ supervisor_cfg }}
supervisorctl_path={{ supervisor_ctl }}
-
name
:
notifier | restart notifier-celery-workers
supervisorctl
:
name=notifier-celery-workers state=restarted
supervisorctl
:
>
name=notifier-celery-workers
state=restarted
config={{ supervisor_cfg }}
supervisorctl_path={{ supervisor_ctl }}
playbooks/roles/notifier/tasks/deploy.yml
View file @
d9227fc4
---
-
name
:
notifier | stop notifier-celery-beat
supervisorctl
:
name=notifier-celery-beat state=restarted
ignore_errors
:
yes
-
name
:
notifier | stop notifier-celery-workers
supervisorctl
:
name=notifier-celery-workers state=restarted
ignore_errors
:
yes
-
name
:
notifier | checkout code
git
:
dest={{ NOTIFIER_CODE_DIR }} repo={{ NOTIFIER_SOURCE_REPO }}
version={{ NOTIFIER_VERSION }}
sudo
:
true
sudo_user
:
"
{{
NOTIFIER_USER
}}"
notify
:
-
notifier | restart notifier
-
notifier | restart notifier-scheduler
-
notifier | restart notifier-celery-workers
tags
:
-
notifier
-
deploy
-
install
-
update
-
name
:
notifier | source repo group perms
file
:
path={{ NOTIFIER_SOURCE_REPO }} mode=2775 state=directory
tags
:
-
notifier
-
deploy
-
install
-
update
-
name
:
notifier | install application requirements
pip
:
...
...
@@ -35,12 +25,10 @@
sudo
:
true
sudo_user
:
"
{{
NOTIFIER_USER
}}"
notify
:
-
notifier | restart notifier
-
notifier | restart notifier-scheduler
-
notifier | restart notifier-celery-workers
tags
:
-
notifier
-
deploy
-
install
-
update
-
name
:
notifier | syncdb
shell
:
>
...
...
@@ -48,9 +36,7 @@
sudo
:
true
sudo_user
:
"
{{
NOTIFIER_USER
}}"
notify
:
-
notifier | restart notifier
-
notifier | restart notifier-scheduler
-
notifier | restart notifier-celery-workers
tags
:
-
notifier
-
deploy
-
install
-
update
-
deploy
\ No newline at end of file
playbooks/roles/notifier/tasks/main.yml
View file @
d9227fc4
...
...
@@ -85,18 +85,18 @@
file
:
path="{{ NOTIFIER_HOME }}/bin" mode=2775 state=directory
-
name
:
common | create supervisor log directoy
file
:
path={{NOTIFIER_SUPERVISOR_LOG_DEST }} mode=2750 state=directory
-
name
:
notifier | supervisord config for celery workers
template
:
src=etc/supervisor/conf.d/notifier-celery-workers.conf.j2 dest=/etc/supervisor/conf.d/notifier-celery-workers.conf
template
:
>
src=edx/app/supervisor/conf.d/notifier-celery-workers.conf.j2
dest="{{ supervisor_cfg_dir }}/notifier-celery-workers.conf"
sudo_user
:
"
{{
supervisor_user
}}"
notify
:
notifier | restart notifier-celery-workers
-
name
:
notifier | supervisord config for scheduler
template
:
src=etc/supervisor/conf.d/notifier-scheduler.conf.j2 dest=/etc/supervisor/conf.d/notifier-scheduler.conf
template
:
>
src=edx/app/supervisor/conf.d/notifier-scheduler.conf.j2
dest="{{ supervisor_cfg_dir }}/notifier-scheduler.conf"
sudo_user
:
"
{{
supervisor_user
}}"
notify
:
notifier | restart notifier-scheduler
-
include
:
deploy.yml
-
include
:
deploy.yml
\ No newline at end of file
playbooks/roles/notifier/templates/e
tc
/supervisor/conf.d/notifier-celery-workers.conf.j2
→
playbooks/roles/notifier/templates/e
dx/app
/supervisor/conf.d/notifier-celery-workers.conf.j2
View file @
d9227fc4
...
...
@@ -16,7 +16,6 @@ startretries=3
exitcodes=0,2
stopsignal=TERM
stopwaitsecs=10
user=notifier
redirect_stderr=false
stdout_logfile={{NOTIFIER_SUPERVISOR_LOG_DEST }}/notifier-celery-workers-stdout.log
stdout_logfile_maxbytes=1MB
...
...
playbooks/roles/notifier/templates/e
tc/supervisor/conf.d/notifier-celery
-scheduler.conf.j2
→
playbooks/roles/notifier/templates/e
dx/app/supervisor/conf.d/notifier
-scheduler.conf.j2
View file @
d9227fc4
...
...
@@ -16,7 +16,6 @@ startretries=3
exitcodes=0,2
stopsignal=TERM
stopwaitsecs=10
user=notifier
redirect_stderr=false
stdout_logfile={{ NOTIFIER_SUPERVISOR_LOG_DEST }}/notifier-scheduler-stdout.log
stdout_logfile_maxbytes=1MB
...
...
playbooks/roles/notifier/templates/etc/supervisor/conf.d/notifier-scheduler.conf.j2
deleted
100644 → 0
View file @
2b385bb7
;
; {{ ansible_managed }}
;
[program:notifier-scheduler]
command={{ NOTIFIER_VENV_DIR }}/bin/python manage.py scheduler
process_name=%(program_name)s
numprocs=1
directory={{ NOTIFIER_CODE_DIR }}
umask=022
autostart=true
autorestart=true
startsecs=10
startretries=3
exitcodes=0,2
stopsignal=TERM
stopwaitsecs=10
user=notifier
redirect_stderr=false
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_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() -%}
{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment