---
# install cython
- name: ensure pip installed
  apt: pkg=python-pip state=latest

- name: pip install dependencies
  pip: name={{ item }} state=latest
  with_items:
    - cython
    - pymongo
    - boto

- name: ensure dependencies installed
  apt: pkg={{ item }} state=latest
  with_items:
    - python-dev
    - libsnappy1
    - libsnappy-dev
    - python-protobuf
    - python-snappy

# set up submodules and python setup install them
- name: python setup install skadi
  command: python setup.py install chdir={{ mq.deploy_path }}/external/skadi

- name: python setup install tarrasque
  command: python setup.py install chdir={{ mq.deploy_path }}/external/tarrasque

- name: copy alacrity config
  template: src=config.cfg.j2 dest={{ mq.deploy_path }}/alacrity/config/config.cfg

- name: copy celery config
  template: src=celeryconfig.py.j2 dest={{ mq.deploy_path }}/alacrity/mq/celeryconfig.py

- name: start or restart celery workers
  sudo: no
  command: celery multi restart {{ num_celery_workers }} --app=alacrity.mq --concurrency={{ celery_concurrency }} --beat chdir={{ mq.deploy_path }}

- name: ensure celery running
  shell: ps aux | grep "celery" | grep -v grep


---
# install cython
- name: ensure pip installed
  apt: pkg=python-pip state=latest

- name: pip install dependencies
  pip: name={{ item }} state=latest
  with_items:
    - cython
    - pymongo
    - boto

- name: ensure dependencies installed
  apt: pkg={{ item }} state=latest
  with_items:
    - python-dev
    - libsnappy1
    - libsnappy-dev
    - python-protobuf
    - python-snappy

# set up submodules and python setup install them
- name: python setup install skadi
  command: python setup.py install chdir={{ mq.deploy_path }}/external/skadi

- name: python setup install tarrasque
  command: python setup.py install chdir={{ mq.deploy_path }}/external/tarrasque

- name: copy alacrity config
  template: src=config.cfg.j2 dest={{ mq.deploy_path }}/alacrity/config/config.cfg
  tags: deploy

- name: copy celery config
  template: src=celeryconfig.py.j2 dest={{ mq.deploy_path }}/alacrity/mq/celeryconfig.py
  tags: deploy

- name: start or restart celery workers
  sudo: no
  command: celery multi restart {{ num_celery_workers }} --app=alacrity.mq --concurrency={{ celery_concurrency }} --beat chdir={{ mq.deploy_path }}
  tags: deploy

- name: ensure celery running
  shell: ps aux | grep "celery" | grep -v grep
  tags: deploy


Add deploy tag to alacrity tasks
Add deploy tag to alacrity tasks
