Skip to content

Commit

Permalink
Merge pull request jprorama#152 from krishmoodbidri/krish/celery-service
Browse files Browse the repository at this point in the history
celery as a system service
  • Loading branch information
jprorama authored Mar 13, 2020
2 parents 0acd266 + 25a06fb commit 43cb984
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions roles/ood_user_reg_cloud/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@
group: apache
state: directory

- name: Copy Celery service template
template:
src: "{{ item }}"
dest: "/etc/systemd/system/{{ item }}"
with_items:
- celery.service

- name: Start celery.service
service:
name: celery.service
state: started
enabled: yes

- name: Put apache config file in place
template:
src: user-reg_conf.j2
Expand Down
13 changes: 13 additions & 0 deletions roles/ood_user_reg_cloud/templates/celery.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Service to start celery process.
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=centos
WorkingDirectory={{ user_register_app_path }}
ExecStart=/usr/bin/env celery -A tasks worker --loglevel=info --concurrency=4
[Install]
WantedBy=multi-user.target

0 comments on commit 43cb984

Please sign in to comment.