---
# tasks file for nodejs
- name: Add the Nodesource signing keys
  apt_key: url=https://deb.nodesource.com/gpgkey/nodesource.gpg.key state=present

- name: Add Nodesource repo (formerly known as Chris Lea repo) for nodejs, because ubuntu
  # Add specified repository into sources list.
  apt_repository: repo='{{ item }} trusty main' state=present update_cache=yes
  with_items:
    - deb https://deb.nodesource.com/node
    - deb-src https://deb.nodesource.com/node
  when: ansible_os_family == "Debian"
  tags: [nodejs, packages]

- name: Install node.js and npm (APT)
  apt: name=nodejs state=latest update_cache=yes
  when: ansible_os_family == "Debian"
  tags: [nodejs, packages]

- name: install uglifiers
  npm: name={{ item }} global=yes state=latest
  with_items:
    - uglify-js
    - uglifycss
  tags: [nodejs, packages]

---
# tasks file for nodejs
- name: Add the Nodesource signing keys
  apt_key: url=https://deb.nodesource.com/gpgkey/nodesource.gpg.key state=present

- name: Add Nodesource repo (formerly known as Chris Lea repo) for nodejs, because ubuntu
  # Add specified repository into sources list.
  apt_repository: repo='{{ item }} trusty main' state=present update_cache=yes
  with_items:
    - deb https://deb.nodesource.com/node_4.x
    - deb-src https://deb.nodesource.com/node_4.x
  when: ansible_os_family == "Debian"
  tags: [nodejs, packages]

- name: Install node.js and npm (APT)
  apt: name=nodejs state=latest update_cache=yes
  when: ansible_os_family == "Debian"
  tags: [nodejs, packages]

- name: install uglifiers
  npm: name={{ item }} global=yes state=latest
  with_items:
    - uglify-js
    - uglifycss
  tags: [nodejs, packages]

Add the repo to install nodejs 4.x LTS.
Add the repo to install nodejs 4.x LTS.
