---
- name: Add PPA for Ruby 2.3, which is required for site-inspector
  become: yes
  apt_repository:
    repo: 'ppa:brightbox/ruby-ng'

- name: Install apt dependencies.
  become: yes
  apt:
    name: "{{ item }}"
    state: present
    update_cache: yes
    # Only update if it's been 24 hours since last time
    cache_valid_time: 86400
  with_items: "{{ apt_packages }}"

- name: Upgrade all packages.
  become: yes
  apt:
    upgrade: safe
    update_cache: yes
    cache_valid_time: 86400

  # https://www.digitalocean.com/community/tutorials/how-to-install-the-django-web-framework-on-ubuntu-14-04
- name: Install Django project requirements
  become: yes
  pip:
    requirements: "/vagrant/securethenews/requirements.txt"
    executable: pip3

- name: Install site-inspector
  become: yes
  gem:
    name: site-inspector

- name: Install gulp
  become: yes
  npm:
    global: yes
    name: gulp

---
- name: Add PPA for Ruby 2.3, which is required for site-inspector
  become: yes
  apt_repository:
    repo: 'ppa:brightbox/ruby-ng'

- name: Install apt dependencies.
  become: yes
  apt:
    name: "{{ item }}"
    state: present
    update_cache: yes
    # Only update if it's been 24 hours since last time
    cache_valid_time: 86400
  with_items: "{{ apt_packages }}"

- name: Upgrade all packages.
  become: yes
  apt:
    upgrade: safe
    update_cache: yes
    cache_valid_time: 86400

  # https://www.digitalocean.com/community/tutorials/how-to-install-the-django-web-framework-on-ubuntu-14-04
- name: Install Django project requirements
  become: yes
  pip:
    requirements: "/vagrant/securethenews/requirements.txt"
    executable: pip3

- name: Install site-inspector
  become: yes
  gem:
    name: site-inspector

- name: Install Node dependencies
  npm:
    path: /vagrant/securethenews

- name: Install gulp globally
  become: yes
  npm:
    global: yes
    name: gulp

Install Node dependencies from package.json
Install Node dependencies from package.json

Apparently this is necessary for the globally installed gulp to run.
