Skip to content

Commit

Permalink
Fix setup-Debian.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lecorguille authored Jun 10, 2024
1 parent b525bfe commit 57d4380
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,18 @@
- gnupg2
state: present

- name: Download NodeSource's signing key.
# NodeSource's web server discriminates the User-Agent used by the deb822_repository module.
# https://github.com/nodesource/distributions/issues/1723
ansible.builtin.get_url:
url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key
dest: /etc/apt/signing-key-nodesource-repo.asc
owner: root
group: root
mode: '0444'
register: node_signing_key

- name: Add NodeSource repositories for Node.js.
ansible.builtin.deb822_repository:
name: nodesource_{{ nodejs_version }}
uris: "https://deb.nodesource.com/node_{{ nodejs_version }}"
types: deb
suites: nodistro
components: main
signed_by: "{{ node_signing_key.dest }}"
# Workaround to fix
# https://github.com/geerlingguy/ansible-role-nodejs/issues/160
# Solution: https://kyle.pericak.com/nodejs-ansible.html
- name: "Add nodejs apt key"
apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present
register: node_repo

- name: "Add nodejs {{ nodejs_version }} ppa for apt repo"
apt_repository:
repo: deb https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_distribution_release }} main
update_cache: yes

- name: Update apt cache if repo was added.
ansible.builtin.apt: update_cache=yes
Expand Down

0 comments on commit 57d4380

Please sign in to comment.