---
- name: Set up Node.js
  command: bash -c "curl -sL https://deb.nodesource.com/setup_4.x | bash -"

- name: Install Node.js
  apt: pkg=nodejs state=installed

- name: Install some NPM Packages
  npm: name="{{ item }}" global=yes state=latest
  with_items:
    - bower
    - gulp-cli
    - grunt-cli
    - webpack
    - browserify
    - babel-cli

---
- name: Set up Node.js
  command: bash -c "curl -sL https://deb.nodesource.com/setup_7.x | bash -"

- name: Install Node.js
  apt: pkg=nodejs state=installed

- name: Install some NPM Packages
  npm: name="{{ item }}" global=yes state=latest
  with_items:
    - yarn
    - bower
    - gulp-cli
    - grunt-cli
    - webpack
    - browserify
    - babel-cli

Upgrade to node 7 and add yarn
Upgrade to node 7 and add yarn
