Skip to content

Instantly share code, notes, and snippets.

@mattduggan
Created March 28, 2018 18:24
Show Gist options
  • Save mattduggan/38e7eba8097f8f1c60a4f953a5470ef2 to your computer and use it in GitHub Desktop.
Save mattduggan/38e7eba8097f8f1c60a4f953a5470ef2 to your computer and use it in GitHub Desktop.
- name: Node.js | Version
tags: dependencies
shell: node -v 2>&1 | sed s/v//
register: node_version
ignore_errors: True
- debug:
msg: "Node.js version: {{ node_version.stdout }}"
- name: Node.js | Download
tags: dependencies
shell: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
when: node_version.stdout | version_compare(nodejs_version, '<')
- name: Node.js | Install
tags: dependencies
apt:
pkg:
- nodejs
state: installed
update_cache: yes
when: node_version.stdout | version_compare(nodejs_version, '<')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment