Skip to content

Commit

Permalink
ansible: update Node.js from 12.x -> 14.x (#2514)
Browse files Browse the repository at this point in the history
* ansible: update Node.js from 12.x -> 14.x

Fixes: #2504

* ansible: update cache after adding NodeSource repo

After adding the NodeSource repository for Node.js, set `update_cache`
on the subsequent "Install node" `package` task to run the equivalent
of `apt-get update` to fetch the package metadata from the newly added
repository.

* ansible: remove previous NodeSource repo

Co-authored-by: Richard Lau <[email protected]>
  • Loading branch information
aduh95 and richardlau authored Feb 15, 2021
1 parent 7642d19 commit 7b51118
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ansible/roles/jenkins-workspace/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,19 @@

- name: Add nodesource repo
apt_repository:
repo: deb https://deb.nodesource.com/node_12.x xenial main
repo: deb https://deb.nodesource.com/node_14.x xenial main
state: present

- name: Remove earlier nodesource repos
apt_repository:
repo: deb https://deb.nodesource.com/node_12.x xenial main
state: absent

- name: Install node
package:
name: nodejs
state: present
update_cache: yes

- name: Upgrade pip2
pip:
Expand Down

0 comments on commit 7b51118

Please sign in to comment.