--- - name: Install virtualenv apt: name=python-virtualenv state=latest - name: Install uwsgi from PyPI pip: name=uwsgi - 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 copy: src=uwsgi.init dest=/etc/init.d/uwsgi backup=yes - name: Make sure the init script is executable file: path=/etc/init.d/uwsgi owner=root group=root mode=0755 - name: Make configuration directory file: /etc/uwsgi/apps state=directory - name: Make sure uwsgi starts on boot service: name=uwsgi enabled=yes notify: - start uwsgi