--- - hosts: all vars: web_server_home: /srv/www rookeries_venv: "{{ web_server_home }}/rookeries" rookeries_package: rookeries-0.4.0.tar.bz2 rookeries_uwsgi_ini: rookeries-uwsgi.ini tasks: - name: Upload rookeries package to web server home copy: src=../../../dist/{{ rookeries_package }} dest={{ web_server_home }} - name: PIP install rookeries package into target virtualenv pip: name={{ rookeries_package }} virtualenv={{ rookeries_venv }} chdir={{ web_server_home }} - name: PIP install extra MySQL python connector dependency pip: name=mysql-connector-python virtualenv={{ rookeries_venv }} version=1.1.6 extra_args='--allow-external mysql-connector-python --allow-unverified mysql-connector-python' # TODO This is problematic, and maybe a good sign why deploying a web app via pip isn't the wisest idea. - name: Link rookeries static pages to top-level of virtualenv file: src={{ rookeries_venv }}/lib/python2.7/site-packages/rookeries/ dest={{ rookeries_venv }}/rookeries state=link # TODO Step 4 - Setup environment variables on target system related to config.