---
- name: Ensure node is installed
  apt:
    pkg: "{{item}}"
    state: latest
  with_items:
   - nodejs
   - nodejs-legacy
   - sqlite # required for node / ghost generally
- name: Check if NPM is here
  command: "which npm"
  ignore_errors: yes
  register: npm_is_here
- name: Install NPM
  shell: curl -L https://npmjs.org/install.sh | sudo sh
  when: npm_is_here.rc != 0
  ignore_errors: yes
---
- name: Ensure node is installed
  apt:
    pkg: "{{item}}"
    state: latest
  with_items:
   - nodejs
   - nodejs-legacy
   - sqlite # required for node / ghost generally
- name: Check if NPM is here
  command: "which npm"
  register: npm_is_here
  ignore_errors: yes
- name: Install NPM
  shell: curl -L -k https://npmjs.org/install.sh | sudo sh
  when: npm_is_here|success
  ignore_errors: yes
Improve curl fetching, add ignore errors flag
Improve curl fetching, add ignore errors flag
