Commit 60b1aeb7 by e0d

Making handlers smarter, applying them where appropriate.

parent e3b2ee50
......@@ -3,13 +3,6 @@
##
## for future compliance, when the API comes on line.
##
- name: notifier | restart the notifier service
service: name=notifier state=restarted
- name: notifier | restart supervisor
service: name=supervisor state=restarted
notify:
- notifier | install notifier-celery-workers
- name: notifier | install notifier-celery-beat
supervisorctl: name=notifier-celery-beat state=present
......@@ -17,6 +10,12 @@
- name: notifier | install notifier-celery-workers
supervisorctl: name=notifier-celery-workers state=present
- name: notifier | restart notifier
supervisorctl: name=notifier-celery-beat state=restarted
notify:
- notifier | install notifier-celery-workers
- notifier | install notifier-celery-beat
- name: notifier | restart notifier-celery-beat
supervisorctl: name=notifier-celery-beat state=restarted
......
......@@ -5,6 +5,8 @@
copy:
src=git_ssh.sh dest=/tmp/git_ssh.sh
force=yes owner=root group=adm mode=750
notify:
- notifier | restart notifier
tags:
- notifier
- deploy
......@@ -18,6 +20,8 @@
copy:
src={{ notifier_git_identity_path }} dest=/etc/git-identity
force=yes owner=ubuntu group=adm mode=60
notify:
- notifier | restart notifier
tags:
- notifier
- deploy
......@@ -30,6 +34,8 @@
version={{ notifier_version }}
environment:
GIT_SSH: /tmp/git_ssh.sh
notify:
- notifier | restart notifier
tags:
- notifier
- deploy
......@@ -43,6 +49,8 @@
file:
path={{ notifier_code_dir }} state=directory owner={{ notifier_user }}
group={{ notifier_user }} mode=2750 recurse=yes
notify:
- notifier | restart notifier
tags:
- notifier
- deploy
......@@ -54,6 +62,8 @@
#
- name: notifier | remove read-only ssh key for the content repo
file: path=/etc/git-identity state=absent
notify:
- notifier | restart notifier
tags:
- notifier
- deploy
......@@ -65,6 +75,8 @@
#
- name: notifier | remove ssh script
file: path=/tmp/git_ssh.sh state=absent
notify:
- notifier | restart notifier
tags:
- notifier
- deploy
......@@ -77,6 +89,8 @@
virtualenv="{{ notifier_venv_dir }}" state=present
sudo: true
sudo_user: "{{ notifier_user }}"
notify:
- notifier | restart notifier
tags:
- notifier
- deploy
......@@ -88,6 +102,8 @@
cd {{ notifier_code_dir }} && {{ notifier_venv_dir }}/bin/python manage.py syncdb
sudo: true
sudo_user: "{{ notifier_user }}"
notify:
- notifier | restart notifier
tags:
- notifier
- deploy
......
......@@ -126,29 +126,6 @@
- install
- update
# TODO: Add version improvement
#
# name: notifier | check if dd is installed
# command: test -e /etc/dd-agent/datadog.conf
# register: dd_present
# ignore_errors: yes
# tags:
# - notifier
# - install
# - update
#
# name: notifier | install datadog agent
# shell: bash -c "$(wget -qO- http://dtdg.co/agent-install-ubuntu)"
# environment:
# DD_API_KEY: "{{ notifier_dd_api_key }}"
# when: dd_present|failed
# tags:
# - notifier
# - install
# - update
# - ubuntu
- name: notifier | create notifier/bin directory
file:
path="{{ notifier_home }}/bin" mode=2775 state=directory
......@@ -157,17 +134,6 @@
- install
- update
- name: notifier | create job script
copy: >
src=opt/notifier/bin/forums_digest.sh
dest={{ notifier_home }}/bin/forums_digest.sh
owner={{ notifier_user }}
group={{ notifier_user }}
tags:
- notifier
- install
- update
- name: notifier | make the script executable
file: path={{ notifier_home }}/bin/forums_digest.sh state=file mode=2755
tags:
......@@ -175,21 +141,10 @@
- install
- update
#- name: notifier | add cron job
# cron:
# name="forums digest" hour={{ notifier_cron_hour }}
# minute="{{ notifier_cron_minute }}" job="$HOME/forums_digest.sh 1440"
# sudo: true
# sudo_user: "{{ notifier_user }}"
# tags:
# - notifier
# - install
# - update
- 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
notify: notifier | restart supervisor
notify: notifier | restart notifier-celery-workers
tags:
- notifier
- install
......@@ -198,7 +153,7 @@
- name: notifier | supervisord config for celery beat
template:
src=etc/supervisor/conf.d/notifier-celery-beat.conf.j2 dest=/etc/supervisor/conf.d/notifier-celery-beat.conf
notify: notifier | restart supervisor
notify: notifier | restart notifier-celery-beat
tags:
- notifier
- install
......
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