From 28f65a781e7e53c7a82ba2fbc6cc5b2ee4cf3197 Mon Sep 17 00:00:00 2001 From: Josh Klar Date: Thu, 11 Feb 2016 11:30:53 -0600 Subject: [PATCH] Add nodejs 5.x support for Debian systems --- tasks/setup-Debian.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 0a1dae5..97903f5 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -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: @@ -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"