ansible-rookeries/tasks/rookeries_deployment.yaml

47 lines
1.6 KiB
YAML

---
- name: verify a deployment package ready for deployment, otherwise skip deployment steps
local_action: stat path={{ rookeries_package_path }}
sudo: no
register: deploy_package
- name: upload + extract rookeries package to web server home
unarchive: src={{ rookeries_package_path }} dest={{ web_root_path }}
when: deploy_package.stat.exists
- name: fix permissions on extracted web app
file: path={{ rookeries_deploy_dir }} owner={{ web_server_group }} group={{ web_server_group }}
state=directory recurse=yes
when: deploy_package.stat.exists
- name: install extra binary tools for jq dependency
apt: pkg={{ item }} state=present
with_items:
- autoconf
- bison
- flex
- libtool
- build-essential
- python-dev
- jq
when: deploy_package.stat.exists
- name: install rookeries dependencies
pip: requirements=requirements.txt virtualenv={{ rookeries_venv }} chdir={{ rookeries_deploy_dir }}
when: deploy_package.stat.exists
- name: install frontend dependencies for app
npm: path={{ rookeries_deploy_dir }} state=present registry=http://registry.npmjs.org/
when: deploy_package.stat.exists
- name: add in symlink to deployed package.
file: state=link src={{ rookeries_deploy_dir }} path={{ rookeries_app_symlink }}
owner={{ web_server_group }} group={{ web_server_group }}
when: deploy_package.stat.exists
- name: add in symlink to deployed virtualenv.
file: state=link src={{ rookeries_venv }} path={{ rookeries_venv_symlink }}
owner={{ web_server_group }} group={{ web_server_group }}
notify:
- restart uwsgi app
when: deploy_package.stat.exists