Ansible wagtail tasks

This commit is contained in:
Oleg Lavrovsky 2020-05-16 15:43:10 +02:00
parent 3481dc11be
commit f668418bd2
4 changed files with 14 additions and 9 deletions

View File

@ -119,6 +119,8 @@ For an update release with a specific version (tag or branch), use (the `-v` par
ansible-playbook ansible/site.yaml -i ansible/inventories/production --tags release -v -e gitversion=<v*.*.*>
```
You can also use the `gitrepo` parameter to use a different fork of the source code.
Once the basic system set up, i.e. you have an `ansible` user in the sudoers and docker group, you are ready to run the playbook.
The typical order of deployment is:

View File

@ -4,22 +4,23 @@
file: path={{ release_dir }} state=directory owner=ansible group=ansible
become: true
- name: Ensure Make is installed
become: true
apt:
pkg: make
- name: Checkout code branch from git
git:
repo: 'https://github.com/datalets/public-health-ch'
dest: "{{ release_dir }}"
force: yes
repo: "{{ gitrepo }}"
version: "{{ gitversion }}"
force: false
- name: Copy Docker site configuration
template:
src: docker-compose.j2
dest: "{{ release_dir }}/docker-compose.yml"
- name: Ensure Make is installed
become: true
apt:
pkg: make
- name: Deploy Wagtail site on Docker
shell: make build
args:

View File

@ -2,10 +2,10 @@
- name: Checkout code branch from git
git:
repo: 'https://github.com/datalets/public-health-ch'
dest: "{{ release_dir }}"
force: yes
repo: "{{ gitrepo }}"
version: "{{ gitversion }}"
force: no
- name: Copy Docker site configuration
template:

View File

@ -2,6 +2,8 @@
become: false
gather_facts: true
vars:
gitrepo: https://github.com/datalets/public-health-ch
gitversion: master
release_dir: /opt/publichealth
archive_dir: /opt/www-old
django_log_dir: /var/log/publichealth