Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
src: etc/apt/preferences.d/deb_nodesource_com_node.pref.2
dest: /etc/apt/preferences.d/deb_nodesource_com_node.pref

- name: Uninstall existing installations of Node.js
apt: name=nodejs state=absent

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some way of making this check it is necessary? It would be way too excessive to have node reinstall itself every time we run through ansible.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since posting this issue I've created my own Ansible implementation of NVM and I no longer use nodesource.

If you were to do so, you should check for an existing install, register a variable with the currently installed version and provide some logic to determine if it should be uninstalled first.

- name: Install Node.js
apt: pkg=nodejs={{ nodejs_version }}.* state=installed update_cache=yes