Skip to content

Commit

Permalink
Merge pull request #16 from iv597/patch-1
Browse files Browse the repository at this point in the history
Add nodejs 5.x support for Debian systems
  • Loading branch information
geerlingguy committed Feb 18, 2016
2 parents f3e4735 + 28f65a7 commit 8259246
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
---
- name: Configure Debian repo version.
when: "'4' in nodejs_version"
set_fact:
debian_repo_version: "{{ nodejs_version if '4' not in nodejs_version else '4.x' }}"
debian_repo_version: "4.x"

- name: Configure Debian repo version.
when: "'5' in nodejs_version"
set_fact:
debian_repo_version: "5.x"

- name: Configure Debian repo version.
when: "'4' not in nodejs_version and '5' not in nodejs_version"
set_fact:
debian_repo_version: "{{ nodejs_version }}"

- name: Add Nodesource apt key.
apt_key:
Expand All @@ -17,4 +28,4 @@
- "deb-src https://deb.nodesource.com/node_{{ debian_repo_version }} {{ ansible_distribution_release }} main"

- name: Ensure Node.js and npm are installed.
apt: "name=nodejs={{ nodejs_version }}* state=present update_cache=yes"
apt: "name=nodejs={{ nodejs_version|regex_replace('x', '') }}* state=present update_cache=yes"

0 comments on commit 8259246

Please sign in to comment.