---
- name: Install Node.js packages
  action: npm name={{ item }} state=latest global=yes
  with_items:
    - gulp
    - ember-cli

- name: Create app directories
  action: file path={{ item }} state=directory
  with_items:
    - /u/apps/knowhow/frontend
    - /u/apps/knowhow/backend

- name: Check out app repositories
  action: git repo={{ item.repo }} dest={{ item.dest }} update=no accept_hostkey=yes
  with_items:
    - repo: https://github.com/Pitt-CSC/knowhow-frontend.git
      dest: /u/apps/knowhow/frontend
    - repo: https://github.com/Pitt-CSC/knowhow-backend.git
      dest: /u/apps/knowhow/backend

- name: Configure nginx site
  action: copy src=site dest=/etc/nginx/sites-enabled/knowhow.pittcsc.org
  notify: Restart nginx

---
- name: Install Node.js packages
  action: npm name={{ item }} state=latest global=yes
  with_items:
    - gulp
    - ember-cli

- name: Create app directories
  action: file path={{ item }} state=directory
  with_items:
    - /u/apps/knowhow/frontend
    - /u/apps/knowhow/backend

- name: Check out app repositories
  action: git repo={{ item.repo }} dest={{ item.dest }} update=no accept_hostkey=yes
  with_items:
    - repo: https://github.com/Pitt-CSC/knowhow-frontend.git
      dest: /u/apps/knowhow/frontend
    - repo: https://github.com/Pitt-CSC/knowhow-backend.git
      dest: /u/apps/knowhow/backend

- name: Configure nginx site
  action: copy src=site dest=/etc/nginx/sites-enabled/knowhow.pittcsc.org
  notify: Restart nginx

- name: Allow HTTP traffic
  action: ufw direction=in proto=tcp port=80 rule=allow
  notify: Reload ufw

Allow HTTP traffic to the Knowhow hosts
Allow HTTP traffic to the Knowhow hosts
