Install node on ubuntu using ansible
The official Node docs recommend using a curlpipe, but I prefer using Ansible explicitly isntead.
- name: install nodejs
hosts: yourhostshere
gather_facts: True
sudo: True
tasks:
- name: add apt key for nodesource
apt_key: url=https://deb.nodesource.com/gpgkey/nodesource.gpg.key
- name: add repo for nodesource
apt_repository:
repo: 'deb https://deb.nodesource.com/node_0.10 {{ ansible_distribution_release }} main'
update_cache: yes
- name: install nodejs
apt: name=nodejs
Written by Lorin Hochstein
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Node
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#