---
# start it up

- name: make sure code is on the box and in sync
  synchronize:
    src: ../../../../../
    dest: "{{base_path}}"
    rsync_opts:
      - --include=.bin/***
      - --include=api/***
      - --include=config/***
      - --include=migrations/***
      - --include=seeds/***
      - --include=package.json
      - --include=index.js
      - --exclude='.*'
      - --exclude='*'
      - --delete-before

- name: run npm install
  npm: path={{base_path}} state=present

- name: create database
  postgresql_db: name=cth

- name: make sure api log file exists
  file: path={{api_log_file}} state=touch mode=0666 owner=www-data group=www-data

- name: (re)start the api
  command: /bin/true
  notify: restart api

---
# start it up

- name: make sure code is on the box and in sync
  synchronize:
    src: ../../../../../
    dest: "{{base_path}}"
    rsync_opts:
      - --include=.bin/***
      - --include=api/***
      - --include=config/***
      - --include=migrations/***
      - --include=seeds/***
      - --include=package.json
      - --include=index.js
      - --include=knexfile.js
      - --exclude='.*'
      - --exclude='*'
      - --delete-before

- name: run npm install
  npm: path={{base_path}} state=present

- name: create database
  postgresql_db: name=cth

- name: make sure api log file exists
  file: path={{api_log_file}} state=touch mode=0666 owner=www-data group=www-data

- name: (re)start the api
  command: /bin/true
  notify: restart api

Modify Ansible task to copy knexfile.
Modify Ansible task to copy knexfile.

Resolves #14
