This commit is contained in:
parent
efd0604c3a
commit
6dfb60165a
12 changed files with 44 additions and 67 deletions
2
roles/nodesource/defaults/main.yaml
Normal file
2
roles/nodesource/defaults/main.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
nodesource_version: 22.x
|
3
roles/nodesource/handlers/main.yaml
Normal file
3
roles/nodesource/handlers/main.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
- ansible.builtin.import_tasks:
|
||||
file: ../../common/handlers/main.yaml
|
33
roles/nodesource/tasks/main.yaml
Normal file
33
roles/nodesource/tasks/main.yaml
Normal file
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
- name: Install dependencies
|
||||
ansible.builtin.apt:
|
||||
state: present
|
||||
pkg:
|
||||
- apt-transport-https
|
||||
- gpg
|
||||
|
||||
- name: Import nodesource signing key
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
set -o pipefail
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg
|
||||
executable: /bin/bash
|
||||
args:
|
||||
creates: /usr/share/keyrings/nodesource.gpg
|
||||
notify: apt update
|
||||
|
||||
- name: Install nodesource apt files
|
||||
ansible.builtin.template:
|
||||
src: nodesource.list
|
||||
dest: /etc/apt/sources.list.d/nodesource.list
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: apt update
|
||||
with_items:
|
||||
- src: nodesource.list
|
||||
dest: /etc/apt/sources.list.d/nodesource.list
|
||||
- src: nodejs-apt-pref
|
||||
dest: /etc/apt/preferences.d/nodejs
|
||||
|
||||
- ansible.builtin.meta: flush_handlers
|
5
roles/nodesource/templates/nodejs-apt-pref
Normal file
5
roles/nodesource/templates/nodejs-apt-pref
Normal file
|
@ -0,0 +1,5 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
Package: nodejs
|
||||
Pin: origin deb.nodesource.com
|
||||
Pin-Priority: 600
|
3
roles/nodesource/templates/nodesource.list
Normal file
3
roles/nodesource/templates/nodesource.list
Normal file
|
@ -0,0 +1,3 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_{{ nodesource_version }} nodistro main
|
Loading…
Add table
Add a link
Reference in a new issue