---
- name: Ensure apt-transport-https is installed
  apt:
    pkg: "{{item}}"
    state: latest
  with_items:
   - apt-transport-https
   - sqlite # required for node / ghost generally
- name: Ensure the key is present
  apt_key:
    url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
- name: Add repository
  apt_repository:
    repo: 'deb https://deb.nodesource.com/node {{ ansible_distribution_release }} main'
    state: present
  notify:
  - Update apt
- name: Add repository
  apt_repository:
    repo: 'deb-src https://deb.nodesource.com/node {{ ansible_distribution_release }} main'
    state: present
  notify:
  - Update apt
- name: Ensure nodejs is installed as root
  sudo: yes
  apt:
    pkg: "{{item}}"
    state: latest
  with_items:
   - nodejs

---
- name: Ensure apt-transport-https is installed
  apt:
    pkg: "{{item}}"
    state: latest
  with_items:
   - apt-transport-https
   - sqlite # required for node / ghost generally
- name: Ensure the key is present
  apt_key:
    url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
- name: Add repository
  apt_repository:
    repo: 'deb https://deb.nodesource.com/node_4.x {{ ansible_distribution_release }} main'
    state: present
    filename: "nodesource"
  notify:
  - Update apt
- name: Add repository (SRC)
  apt_repository:
    repo: 'deb-src https://deb.nodesource.com/node_4.x {{ ansible_distribution_release }} main'
    state: present
    filename: "nodesource"
  notify:
  - Update apt
- name: Ensure nodejs is installed as root
  sudo: yes
  apt:
    pkg: "{{item}}"
    state: latest
  with_items:
   - nodejs

Switch to node v4.4.3 LTS
Switch to node v4.4.3 LTS
