Skip to content

Commit

Permalink
Switched to nodesource
Browse files Browse the repository at this point in the history
  • Loading branch information
soupdiver authored and David Farrington committed May 4, 2016
1 parent a656fab commit f1c92d4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# file: nodejs/defaults/main.yml

nodejs_install_method : "source"
nodejs_version : "0.10.26"
nodejs_version : "0.10.40"

nodejs_directory : "/usr/local/nodejs"
nodejs_source_url : "https://nodejs.org/dist/v{{nodejs_version}}/node-v{{nodejs_version}}.tar.gz"
Expand Down
24 changes: 20 additions & 4 deletions tasks/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,28 @@
pkg: python-pycurl
state: present

- name: nodejs | Add the nodejs repository
apt_repository:
repo: ppa:chris-lea/node.js
- name: node.js | get release
shell: lsb_release -c -s
changed_when: false
register: distro

- name: node.js | add signing key
apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present

- name: node.js | add sources.list entry
lineinfile:
dest: /etc/apt/sources.list.d/nodesource.list
create: yes
line: "{{ item }}"
state: present
with_items:
- "deb https://deb.nodesource.com/node {{ distro.stdout }} main"
- "deb-src https://deb.nodesource.com/node {{ distro.stdout }} main"

- name: node.js | Install the node.js package
apt:
pkg: nodejs={{nodejs_version}}
pkg: "nodejs={{ nodejs_version }}-1nodesource1~{{ distro.stdout }}1"
update_cache: yes
state: present

0 comments on commit f1c92d4

Please sign in to comment.