Skip to content

Instantly share code, notes, and snippets.

@dstokes
Created October 17, 2013 00:53
Show Gist options
  • Save dstokes/7017565 to your computer and use it in GitHub Desktop.
Save dstokes/7017565 to your computer and use it in GitHub Desktop.
---
- hosts: all
sudo: yes
vars:
- nodejs_version: 0.10.20
tasks:
- name: Install node / npm depencencies
apt: pkg={{ item }} state=present
with_items:
# for compiling npm binary modules
- build-essential
- name: Create package stub variable for convenience
shell: echo node-v${nodejs_version}-linux-x64
register: pkg_stub
- name: Get nodejs tarball
get_url:
dest: /usr/local/src/${pkg_stub.stdout}.tar.gz
url: http://nodejs.org/dist/v${nodejs_version}/${pkg_stub.stdout}.tar.gz
- name: Install nodejs binary (${nodejs_version})
shell: >
tar xf /usr/local/src/${pkg_stub.stdout}.tar.gz
--strip-components=1 --no-same-owner
-C /usr/local
${pkg_stub.stdout}/bin
${pkg_stub.stdout}/lib
${pkg_stub.stdout}/share
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment