--- - name: install uwsgi server pip: name=uwsgi virtualenv={{ uwsgi_venv }} version=2.0 sudo: yes - name: configure app on uwsgi server template: src=app_uwsgi.ini dest={{ uwsgi_config_path }}/{{ uwsgi_app_ini }} sudo: yes notify: restart uwsgi app - name: configure nginx app with uwsgi specific block. blockinfile: dest: /etc/nginx/sites-available/{{ nginx_app_config }} insertafter: "# Include your setup to connect to the webapp setup here." marker: "# -- {mark} UWSGI App config for {{ app_name }} --" block: | include uwsgi_params; uwsgi_pass 127.0.0.1:{{ app_uwsgi_port }}; sudo: yes notify: restart nginx