ansible-playbooks/debian/roles/appservers-uwsgi/tasks/main.yml

25 lines
1.0 KiB
YAML
Raw Normal View History

2014-05-16 01:39:57 +00:00
---
- name: Install virtualenv
apt: name=python-virtualenv state=latest
- name: Install uwsgi from PyPI
2014-05-16 01:50:21 +00:00
pip: name=uWSGI
2014-05-16 01:39:57 +00:00
- name: Add uwsgi group
group: name=uwsgi state=present
- name: Add uwsgi user
user: name=uwsgi shell=/sbin/nologin createhome=no group=uwsgi password=$6$Qu5GfWUlAPXh$Ie8Fd9Vzl.PpaFciUbRCI4sIryI6i0rDE29Vf86/WYHgPSWG7x9IIkVU.tG1Mtfq2OM9IeH2IuvOKCcnErMgC1
- name: Copy over the uwsgi init script and logrotate config
copy: src={{ item.name }} dest={{ item.dir }} backup=yes
with_items:
2014-05-16 02:05:56 +00:00
- { name: 'uwsgi.init', dir: '/etc/init.d/uwsgi' }
- { name: 'uwsgi.logrotate', dir: '/etc/logrotate.d/uwsgi' }
2014-05-16 01:39:57 +00:00
- name: Make sure the init script is executable
file: path=/etc/init.d/uwsgi owner=root group=root mode=0755
- name: Make configuration directory
2014-05-16 01:54:12 +00:00
file: path=/etc/uwsgi/apps state=directory
- name: Make log file with correct permissions
2014-05-16 02:07:08 +00:00
file: path=/var/log/uwsgi.log owner=uwsgi group=uwsgi mode=0750 state=touch
2014-05-16 01:39:57 +00:00
- name: Make sure uwsgi starts on boot
service: name=uwsgi enabled=yes
notify:
- start uwsgi