---
- name: Ensure git is installed
  apt: pkg=git
- name: Ensure that deploy owns /var/www
  file: owner=deploy group=deploy path=/var/www
- name: Generate the apache config for the app
  template: src=default
            dest=/etc/apache2/sites-available/default
  notify: Restart Apache
- name: Ensure that .env exists (but will need to be filled in by hand)
  file: path=/var/www/shared/.env owner=deploy group=deploy state=touch

---
# TODO Ensure that deploy user is setup first
# TODO Ensure that apache is setup first
- name: Ensure git is installed
  apt: pkg=git
- name: Ensure that deploy owns /var/www
  file: owner=deploy group=deploy path=/var/www
- name: Generate the apache config for the app
  template: src=default
            dest=/etc/apache2/sites-available/default
  notify: Restart Apache
- name: Ensure that .env exists (but will need to be filled in by hand)
  file: path=/var/www/shared/.env owner=deploy group=deploy state=touch
# TODO This is a nasty hack. Would be much nicer to do this in the capistrano
# deploy. But security concerns (the need for passwordless sudo) make this hard.
- name: Install foreman
  gem: name=foreman state=present
- name: Ensure Procfile.vagrant copied
  copy: src=../Procfile.vagrant dest=/home/deploy/Procfile.vagrant
- name: Ensure upstart is setup for the application
  command: foreman export upstart /etc/init -u deploy -a scraping-platform -f /home/deploy/Procfile.vagrant --root /var/www/current
Add hack to setup upstart (better done in capistrano)
Add hack to setup upstart (better done in capistrano)
