Skip to content

Commit

Permalink
Issue #158: Fix RHEL pubkey setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Feb 20, 2024
1 parent 8501c31 commit b525bfe
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions tasks/setup-RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,19 @@
---
- name: Set up the Nodesource RPM directory.
set_fact:
nodejs_rhel_rpm_dir: "pub_{{ nodejs_version }}"

- name: Import Nodesource RPM key (CentOS < 7).
- name: Import Nodesource RPM key.
rpm_key:
key: http://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
state: present
when: ansible_distribution_major_version | int < 7

- name: Import Nodesource RPM key (CentOS 7+).
rpm_key:
key: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
state: present
when: ansible_distribution_major_version | int >= 7

- name: Add Nodesource repositories for Node.js (CentOS < 7).
yum:
name: "http://rpm.nodesource.com/{{ nodejs_rhel_rpm_dir }}/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm"
key: https://rpm.nodesource.com/gpgkey/nodesource.gpg.key
state: present
when: ansible_distribution_major_version | int < 7
register: node_repo

- name: Add Nodesource repositories for Node.js (CentOS 7+).
- name: Add Nodesource repositories for Node.js.
yum:
name: "https://rpm.nodesource.com/{{ nodejs_rhel_rpm_dir }}/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm"
name: "https://rpm.nodesource.com/pub_{{ nodejs_version }}/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm"
state: present
when: ansible_distribution_major_version | int >= 7
register: node_repo

- name: Update package cache if repo was added.
yum: update_cache=yes
yum:
update_cache: true
when: node_repo is changed
tags: ['skip_ansible_lint']

Expand Down

0 comments on commit b525bfe

Please sign in to comment.