---
- name: Checkout kernel-ci-frontend code
  git:  repo=http://git.linaro.org/git/infrastructure/kernel-ci-frontend.git
        dest={{ install_base }}/{{ hostname }}
        version={{ git_head }}
        update=yes
  tags:
    - install
    - app
  notify:
    - reload-uwsgi

- name: Fix cloned repo permissions
  file: path={{ install_base }}/{{ hostname }}
        state=directory
        recurse=yes
        owner={{ app_user }}
        group={{ app_user }}
  tags:
    - install
    - app

- name: Install pip requirements
  pip:  requirements={{ install_base }}/{{ hostname }}/requirements.txt
        virtualenv={{ install_base }}/.venv/{{ hostname }}
  tags:
    - install
    - app
  notify:
    - reload-uwsgi

- name: Fix virtualenv permissions
  file: path={{ install_base }}/.venv/{{ hostname }}
        state=directory
        recurse=yes
        owner={{ app_user }}
        group={{ app_user }}
  tags:
    - install
    - app

- name: Copy app settings file
  template: src=flask_settings
            dest=/etc/linaro/kernelci-frontend.cfg
            owner=root
            group=root
            mode=0644
  tags:
    - install
    - app
    - secrets

---
- name: Checkout kernel-ci-frontend code
  git:  repo=http://git.linaro.org/git/infrastructure/kernel-ci-frontend.git
        dest={{ install_base }}/{{ hostname }}
        version={{ git_head }}
        update=yes
  tags:
    - install
    - app
  notify:
    - reload-uwsgi

- name: Fix cloned repo permissions
  file: path={{ install_base }}/{{ hostname }}
        state=directory
        recurse=yes
        owner={{ app_user }}
        group={{ app_user }}
  tags:
    - install
    - app

- name: Install pip requirements
  pip:  requirements={{ install_base }}/{{ hostname }}/requirements.txt
        virtualenv={{ install_base }}/.venv/{{ hostname }}
  tags:
    - install
    - app
  notify:
    - reload-uwsgi

- name: Fix virtualenv permissions
  file: path={{ install_base }}/.venv/{{ hostname }}
        state=directory
        recurse=yes
        owner={{ app_user }}
        group={{ app_user }}
  tags:
    - install
    - app

- name: Copy app settings file
  template: src=flask_settings
            dest=/etc/linaro/kernelci-frontend.cfg
            owner=root
            group=root
            mode=0644
  tags:
    - install
    - app
    - secrets

- name: Create empty flask_settings
  file: path=/etc/flask_settings
        owner=root
        group=root
        mode=0644
        state=touch
  tags:
    - install
    - app

Create empty Flask settings file.
ansible: Create empty Flask settings file.

Change-Id: I0046a61f5a4b692e2820747ed67e8bfeabec3866
