Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible: update NodeSource repository setup #3805

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Changes from 1 commit
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
20 changes: 16 additions & 4 deletions ansible/roles/jenkins-workspace/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,39 @@
scope: file
value: 0

- name: Add nodesource signing key
# Remove old NodeSource repository setup
- name: Remove old nodesource signing key
apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present
state: absent

- name: Get Ubuntu codename
ansible.builtin.command: "lsb_release -s -c"
changed_when: no
check_mode: no
register: release_codename

- name: Add nodesource 20 repo
- name: Remove nodesource 20 repo
apt_repository:
repo: deb https://deb.nodesource.com/node_20.x {{ release_codename.stdout }} main
state: present
state: absent

- name: Remove nodesource 16 repo
apt_repository:
repo: deb https://deb.nodesource.com/node_16.x {{ release_codename.stdout }} main
state: absent

# NodeSource distribution
- name: Add nodesource signing key
ansible.builtin.get_url:
dest: /etc/apt/keyrings/nodesource-repo.gpg.asc
url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key

- name: Add nodesource 20 repo
apt_repository:
repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/nodesource-repo.gpg.asc] https://deb.nodesource.com/node_20.x nodistro main
state: present

- name: Install node
package:
name: nodejs
Expand Down