diff --git a/playbooks/roles/nodejs/tasks/debian_family.yml b/playbooks/roles/nodejs/tasks/debian_family.yml index a9930529..b2985729 100644 --- a/playbooks/roles/nodejs/tasks/debian_family.yml +++ b/playbooks/roles/nodejs/tasks/debian_family.yml @@ -1,4 +1,10 @@ --- +- name: 'Add Node.js PPA' + tags: 'nodejs' + become: 'yes' + become_method: 'sudo' + shell: "curl --silent --location https://deb.nodesource.com/setup_{{ node_version }}.x | bash -" + - name: Install nodejs {{ node_version }} apt: name: nodejs diff --git a/playbooks/roles/nodejs/tasks/main.yml b/playbooks/roles/nodejs/tasks/main.yml index 6ff013d7..097d4598 100644 --- a/playbooks/roles/nodejs/tasks/main.yml +++ b/playbooks/roles/nodejs/tasks/main.yml @@ -1,12 +1,4 @@ --- -# Install's prerequisites, like fonts, image libraries, vim, screen, python-dev and gcc - -- name: 'Add Node.js PPA' - tags: 'nodejs' - become: 'yes' - become_method: 'sudo' - shell: "curl --silent --location https://deb.nodesource.com/setup_{{ node_version }}.x | bash -" - - include_tasks: debian_family.yml when: ansible_os_family == 'Debian' diff --git a/playbooks/roles/nodejs/tasks/redhat_family.yml b/playbooks/roles/nodejs/tasks/redhat_family.yml index 1c3d8fb1..af47854c 100644 --- a/playbooks/roles/nodejs/tasks/redhat_family.yml +++ b/playbooks/roles/nodejs/tasks/redhat_family.yml @@ -1,4 +1,10 @@ --- +- name: 'Add Node.js PPA' + tags: 'nodejs' + become: 'yes' + become_method: 'sudo' + shell: "curl --silent --location https://rpm.nodesource.com/setup_{{ node_version }}.x | sudo bash -" + - name: Install node v{{ node_version }} yum: name=nodejs state=present when: ansible_os_family == 'RedHat'