fix: install node for data engineering jenkins - #363
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the jenkins_data_engineering_new Ansible role to ensure Node.js is installed on the Data Engineering Jenkins hosts by configuring the NodeSource apt repository and adding a default Node.js major version.
Changes:
- Add tasks to install the NodeSource GPG key, configure the NodeSource apt repository, and install the
nodejspackage. - Introduce a default
JENKINS_DATA_ENGINEERING_NODE_VERSION(set to20) used when configuring the NodeSource repository.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
playbooks/roles/jenkins_data_engineering_new/tasks/main.yml |
Adds NodeSource key/repo setup and Node.js installation tasks for the Jenkins DE role. |
playbooks/roles/jenkins_data_engineering_new/defaults/main.yml |
Adds a default Node.js major version used by the new repository configuration. |
Suppressed comments (1)
playbooks/roles/jenkins_data_engineering_new/tasks/main.yml:34
- Installing Node.js via apt can fail transiently (repo metadata races, network, lock contention). To reduce flaky runs, consider using the same
register/until/retriespattern used inplaybooks/roles/edxapp/tasks/main.yml:147-156. This also fixes the invalidtagsindentation in this task.
- name: Install Node.js
apt:
name: nodejs
state: present
update_cache: yes
tags:
- jenkins
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
playbooks/roles/jenkins_data_engineering_new/tasks/main.yml:30
- The NodeSource repository is added using
apt_key(which relies on the deprecatedapt-keymechanism on newer Debian/Ubuntu) and the repository line does not scope the key viasigned-by. This can break on newer images whereapt-keyis removed, and it also makes it harder to avoid key collisions with other repos. Prefer the keyring +signed-by=pattern already used elsewhere in this repo (e.g.,playbooks/roles/docker-tools/tasks/main.yml:53-68).
- name: Install the gpg key for Node.js
apt_key:
url: "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key"
state: present
tags:
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
playbooks/roles/jenkins_data_engineering_new/tasks/main.yml:29
apt_keyinstalls the NodeSource key into the global apt trusted keyring (apt-key), which is deprecated on modern Debian/Ubuntu and can cause warnings/failures as apt tightens key handling. This repo already uses per-repo keyrings +signed-byfor apt sources (e.g.,playbooks/roles/docker-tools/tasks/main.yml:53-67), which scopes trust to just that repository.
- name: Install the gpg key for Node.js
apt_key:
url: "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key"
state: present
tags:
- jenkins
- name: Install the Node.js repo
apt_repository:
repo: "deb https://deb.nodesource.com/node_{{ JENKINS_DATA_ENGINEERING_NODE_VERSION }}.x nodistro main"
state: present
update_cache: yes
Make sure that the following steps are done before merging: