Add a distinct nodesource role

This commit is contained in:
polyfloyd 2025-04-30 19:33:26 +02:00
parent efd0604c3a
commit 6dfb60165a
12 changed files with 44 additions and 67 deletions

View file

@ -1,4 +1,3 @@
nodejs_version: 22.x
etherpad_db_user: etherpad
etherpad_db_password: "{{ lookup('password', '/tmp/etherpad_db_password length=32') }}"
etherpad_db_name: etherpad

View file

@ -3,43 +3,10 @@
- name: Install dependencies
ansible.builtin.apt:
state: present
pkg:
- gpg
pkg:
- nodejs
- postgresql
- python3-psycopg2
- apt-transport-https
- name: Import nodesource signing key
ansible.builtin.shell:
cmd: curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor
-o /usr/share/keyrings/nodesource.gpg
args:
creates: /usr/share/keyrings/nodesource.gpg
notify: apt update
- name: Install nodesource source list
ansible.builtin.template:
src: nodesource.list
dest: /etc/apt/sources.list.d/nodesource.list
owner: root
group: root
mode: 0644
notify: apt update
- name: Install nodejs apt preference
ansible.builtin.template:
src: nodejs-apt-pref
dest: /etc/apt/preferences.d/nodejs
owner: root
group: root
mode: 0644
notify: apt update
- ansible.builtin.meta: flush_handlers
- name: Install nodejs
ansible.builtin.apt:
name: nodejs
- name: Add database user
become: true

View file

@ -1,5 +0,0 @@
# {{ ansible_managed }}
Package: nodejs
Pin: origin deb.nodesource.com
Pin-Priority: 600

View file

@ -1,3 +0,0 @@
# {{ ansible_managed }}
deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_{{ nodejs_version }} nodistro main