debugging setup of celery

pull/1/head
Raymond Yee 2016-06-22 11:42:22 -07:00
parent cb010751e5
commit 8943bf27bc
1 changed files with 41 additions and 39 deletions

View File

@ -327,9 +327,9 @@
- name: enable ufw - name: enable ufw
ufw: state=enabled ufw: state=enabled
#with cd("/opt/regluit"):
# # create celery user and group
# sudo ("yes | adduser --no-create-home celery --disabled-password --disabled-login") # also put {{user}} into celery group
- name: make celery group - name: make celery group
group: name=celery group: name=celery
@ -341,16 +341,22 @@
group=celery group=celery
generate_ssh_key=no generate_ssh_key=no
#sudo ("cp deploy/celeryd /etc/init.d/celeryd")
#sudo ("chmod 755 /etc/init.d/celeryd")
# put {{user}} into celery group
- name: add {{user}} to celery group - name: add {{user}} to celery group
user: name={{user}} groups=celery append=yes user: name={{user}} groups=celery append=yes
# still need? # create directories for celery
- name: copy deploy/celeryd # /var/log/celery and /var/run/celery
command: cp /opt/regluit/deploy/celeryd /etc/init.d/celeryd
- name: create /var/log/celery
file: path=/var/log/celery state=directory owner=celery group=celery mode=0775
- name: create /var/run/celery
file: path=/var/run/celery state=directory owner=celery group=celery mode=0775
# set up celeryd
- name: set up /etc/init.d/celeryd (from deploy/celeryd)
command: cp /opt/regluit/deploy/celeryd
# still need? # still need?
- name: set mode on /etc/init.d/celeryd - name: set mode on /etc/init.d/celeryd
@ -362,59 +368,55 @@
- name: set mode on /etc/default/celeryd - name: set mode on /etc/default/celeryd
file: path=/etc/default/celeryd mode=0644 file: path=/etc/default/celeryd mode=0644
# sudo ("mkdir /var/log/celery") - name: just before launching celeryd
- name: make /var/log/celery pause: prompt='Press return to continue. Press Ctrl+c and then "a" to abort'
file: path=/var/log/celery state=directory owner=celery group=celery mode=0775
# sudo ("mkdir /var/run/celery") # start up celeryd
# sudo ("chown celery:celery /var/log/celery /var/run/celery")
- name: make /var/run/celery
file: path=/var/run/celery state=directory owner=celery group=celery mode=0775
# sudo ("/etc/init.d/celeryd start") # sudo ("/etc/init.d/celeryd start")
# old way with root # old way with root
# - name: start celeryd # - name: start celeryd
# command: /etc/init.d/celeryd start # command: /etc/init.d/celeryd start
# celery multi - name: start celery queue with celery multi
- name: celery multi
command: /opt/regluit/ENV/bin/celery multi restart w1 --logfile=\"/var/log/celery/%n.log\" --pidfile=\"/var/log/celery/%n.pid\" command: /opt/regluit/ENV/bin/celery multi restart w1 --logfile=\"/var/log/celery/%n.log\" --pidfile=\"/var/log/celery/%n.pid\"
sudo: no sudo: no
- name: just after attempt to launch celeryd
pause: prompt='Press return to continue. Press Ctrl+c and then "a" to abort'
# sudo ("cp deploy/celerybeat /etc/init.d/celerybeat") # sudo ("cp deploy/celerybeat /etc/init.d/celerybeat")
# sudo ("chmod 755 /etc/init.d/celerybeat") # sudo ("chmod 755 /etc/init.d/celerybeat")
# https://stackoverflow.com/questions/24162996/how-to-move-rename-a-file-using-an-ansible-task-on-a-remote-system # https://stackoverflow.com/questions/24162996/how-to-move-rename-a-file-using-an-ansible-task-on-a-remote-system
# set up celerybeat
- name: copy deploy/celerybeat - name: copy deploy/celerybeat
command: cp /opt/regluit/deploy/celerybeat /etc/init.d/celerybeat command: cp /opt/regluit/deploy/celerybeat /etc/init.d/celerybeat
sudo: yes
- name: set mode on /etc/init.d/celerybeat - name: set mode on /etc/init.d/celerybeat
file: path=/etc/init.d/celerybeat mode=0775 file: path=/etc/init.d/celerybeat mode=0775
sudo: yes
# sudo ("cp deploy/celerybeat.conf /etc/default/celerybeat") - name: copy deploy/celerybeat,conf to /etc/default/celerybeat
- name: copy deploy/celerybeat,conf
command: cp "/opt/regluit/deploy/celerybeat_{{class}}.conf" /etc/default/celerybeat command: cp "/opt/regluit/deploy/celerybeat_{{class}}.conf" /etc/default/celerybeat
sudo: yes
- name: set mode on /etc/default/celerybeat - name: set mode on /etc/default/celerybeat
file: path=/etc/default/celerybeat mode=0775 file: path=/etc/default/celerybeat mode=0775
sudo: yes
# sudo ("mkdir /var/log/celerybeat") - name: create /var/log/celerybeat
# sudo ("chown celery:celery /var/log/celerybeat")
- name: make /var/log/celerybeat
file: path=/var/log/celerybeat state=directory owner=celery group=celery mode=0775 file: path=/var/log/celerybeat state=directory owner=celery group=celery mode=0775
# sudo ("/etc/init.d/celerybeat start") - name: just before launching celerybeat
pause: prompt='Press return to continue. Press Ctrl+c and then "a" to abort'
- name: start celerybeat - name: start celerybeat
command: /etc/init.d/celerybeat start command: /etc/init.d/celerybeat start
sudo: no sudo: no
- name: just after attempt to launch celerybeat
pause: prompt='Press return to continue. Press Ctrl+c and then "a" to abort'
# run data loading script # run data loading script
- name: run data loading script - name: run data loading script
script: "load_data_{{class}}.sh" script: "load_data_{{class}}.sh"