Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit c14b3da0 authored by Jean-François HOVINNE's avatar Jean-François HOVINNE
Browse files

chore: Update nodesource repositories (fixes #15)

parent c0e7cbe2
No related branches found
No related tags found
1 merge request!15chore: Update nodesource repositories (fixes #15)
......@@ -5,11 +5,22 @@
- apt-transport-https
state: present
- name: Add Nodesource apt key
ansible.builtin.apt_key:
url: https://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x1655A0AB68576280
id: "68576280"
state: present
- name: Disable previous NodeSource repository
ansible.builtin.apt_repository:
repo: "{{ item }}"
state: absent
with_items:
- "deb https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_distribution_release }} main"
- "deb-src https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_distribution_release }} main"
notify: Update apt cache
become: true
- name: Import key (APT)
ansible.builtin.get_url:
url: "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key"
dest: "/usr/share/keyrings/nodesource-keyring.asc"
mode: '0644'
force: true
become: true
- name: Add NodeSource repositories for Node.js
......@@ -17,8 +28,7 @@
repo: "{{ item }}"
state: present
with_items:
- "deb https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_distribution_release }} main"
- "deb-src https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_distribution_release }} main"
- "deb [signed-by=/usr/share/keyrings/nodesource-keyring.asc] https://deb.nodesource.com/node_{{ nodejs_version }} nodistro main"
notify: Update apt cache
become: true
......
---
- name: Set up the Nodesource RPM directory
- name: Set up the NodeSource RPM directory
ansible.builtin.set_fact:
rhel_distribution_major_version: 7
- name: Set up the Nodesource RPM directory
- name: Set up the NodeSource RPM directory
ansible.builtin.set_fact:
rhel_distribution_major_version: "{{ ansible_distribution_major_version }}"
when: ansible_distribution_major_version | int >= 8
- name: Import Nodesource RPM key
- name: Import NodeSource RPM key
ansible.builtin.rpm_key:
key: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
key: https://rpm.nodesource.com/gpgkey/nodesource.gpg.key
state: present
become: true
- name: Disable nodesource repository installed by rpm package
ansible.builtin.yum:
name: nodesource-release
- name: Remove previous NodeSource repository file
ansible.builtin.file:
path: "/etc/yum.repos.d/nodesource-{{ nodejs_version }}.repo"
state: absent
notify: Clean yum metadata
become: true
- name: Add Node.js repository file
ansible.builtin.template:
src: nodesource.repo.j2
dest: "/etc/yum.repos.d/nodesource-{{ nodejs_version }}.repo"
src: nodesource-nodejs.repo.j2
dest: "/etc/yum.repos.d/nodesource-nodejs-{{ nodejs_version }}.repo"
owner: root
group: root
mode: '0644'
......@@ -41,7 +42,7 @@
ansible.builtin.yum:
name: "nodejs-{{ nodejs_version | regex_replace('x', '') }}*"
state: present
enablerepo: "nodesource-{{ nodejs_version }}"
enablerepo: "nodesource-nodejs-{{ nodejs_version }}"
allow_downgrade: true
become: true
......
[nodesource-nodejs-{{ nodejs_version }}]
name=Node.js {{ nodejs_version }} Packages for Linux RPM based distros
baseurl=https://rpm.nodesource.com/pub_{{ nodejs_version }}/nodistro/nodejs/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
[nodesource-{{ nodejs_version }}]
name=Node.js {{ nodejs_version }} Packages for Enterprise Linux {{ rhel_distribution_major_version }} - $basearch
baseurl=https://rpm.nodesource.com/pub_{{ nodejs_version }}/el/{{ rhel_distribution_major_version }}/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment