summaryrefslogtreecommitdiff
path: root/per-service/patchwork/roles/patchwork-pre-django/tasks/main.yml
blob: a7333010f9e8f5d999083329ee375a1efb29ab38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- name: Install apt dependencies
  apt: name={{item}} state=installed
  with_items:
    - python-dulwich
    - python-mock
    - python-pip

- name: Create base directory for installation
  file: path={{install_base}}/{{hostname}}
        owner={{apache_user}} group={{apache_user}} mode=0755 state=directory

- name: Create directory for git repos
  file: path="{{install_base}}/{{hostname}}/repos" state=directory
        owner={{apache_user}} group={{apache_user}}

- name: Install patchwork tools
  git: repo=https://git.linaro.org/infrastructure/patchwork-tools.git
       dest={{install_base}}/{{hostname}}/tools
       update=yes accept_hostkey=true version="HEAD"
  become_user: "{{apache_user}}"
  tags:
  - update

- name: Copy apache wsgi script
  copy: src=files/wsgi.py
        dest={{install_base}}/{{hostname}}/wsgi.py
        owner={{apache_user}} group={{apache_user}} mode=0755
  notify: restart-apache
  tags:
    - update

- name: Install cron for patchwork
  template: src=templates/patchwork.cron.d dest=/etc/cron.d/patchwork
            owner=root group=root mode=0644

- name: Clone django-crowd-rest-backend repository
  git:  repo=http://git.linaro.org/lava/django-crowd-rest-backend.git
        dest=/srv/django-crowd-rest-backend version="HEAD"
  register: crowdbackend

- name: Install django-crowd-rest-backed
  command: python ./setup.py install
           chdir=/srv/django-crowd-rest-backend
  when: crowdbackend is defined and crowdbackend.changed