Skip to content

Commit b525bfe

Browse files
committed
Issue geerlingguy#158: Fix RHEL pubkey setup.
1 parent 8501c31 commit b525bfe

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

tasks/setup-RedHat.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,19 @@
11
---
2-
- name: Set up the Nodesource RPM directory.
3-
set_fact:
4-
nodejs_rhel_rpm_dir: "pub_{{ nodejs_version }}"
5-
6-
- name: Import Nodesource RPM key (CentOS < 7).
2+
- name: Import Nodesource RPM key.
73
rpm_key:
8-
key: http://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
9-
state: present
10-
when: ansible_distribution_major_version | int < 7
11-
12-
- name: Import Nodesource RPM key (CentOS 7+).
13-
rpm_key:
14-
key: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
15-
state: present
16-
when: ansible_distribution_major_version | int >= 7
17-
18-
- name: Add Nodesource repositories for Node.js (CentOS < 7).
19-
yum:
20-
name: "http://rpm.nodesource.com/{{ nodejs_rhel_rpm_dir }}/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm"
4+
key: https://rpm.nodesource.com/gpgkey/nodesource.gpg.key
215
state: present
22-
when: ansible_distribution_major_version | int < 7
23-
register: node_repo
246

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

3214
- name: Update package cache if repo was added.
33-
yum: update_cache=yes
15+
yum:
16+
update_cache: true
3417
when: node_repo is changed
3518
tags: ['skip_ansible_lint']
3619

0 commit comments

Comments
 (0)