npm + corepack + yarn on Debian 12

This commit is contained in:
Mathieu Gauthier-Pilote 2024-05-15 14:52:52 -04:00
parent b6a4b1a0d2
commit 9861bfac81
3 changed files with 25 additions and 7 deletions

View file

@ -1,8 +1,8 @@
---
# defaults file for vars
peertube_system_dep: "['curl', 'python3-dev', 'python-is-python3', 'python3-psycopg2','certbot', 'nginx', 'ffmpeg', 'postgresql', 'postgresql-contrib', 'openssl', 'g++', 'make', 'redis-server', 'git', 'unzip', 'acl']"
peertube_system_dep: "['curl', 'python3-dev', 'python-is-python3', 'python3-psycopg2','certbot', 'nginx', 'ffmpeg', 'postgresql', 'postgresql-contrib', 'openssl', 'g++', 'make', 'redis-server', 'git', 'unzip', 'acl', 'npm']"
peertube_version: 'v6.0.1'
peertube_download_url: "https://github.com/Chocobozzz/PeerTube/releases/download/{{ version }}/peertube-{{ version }}.zip"
peertube_download_url: "https://github.com/Chocobozzz/PeerTube/releases/download/{{ peertube_version }}/peertube-{{ peertube_version }}.zip"
peertube_domains: ['example.domain.org']
peertube_certbot_admin_email: 'security@evolix.fr'
peertube_service_home: '/var/www/peertube'

View file

@ -0,0 +1,7 @@
---
- name: Add bullseye-backports repo into sources list (for redis) when Debian 11
apt_repository:
repo: deb http://mirror.evolix.org/debian bullseye-backports main
state: present
when: ansible_distribution_major_version is version('11')

View file

@ -1,21 +1,32 @@
---
# tasks file for peertube install
- name: Add bullseye-backports repo into sources list (for redis)
apt_repository:
repo: deb http://mirror.evolix.org/debian bullseye-backports main
state: present
- name: APT sources
ansible.builtin.include_tasks: apt_sources.yml
- name: Install main system dependencies
apt:
name: "{{ peertube_system_dep }}"
update_cache: yes
- name: Upgrade redis-server to the latest version from bullseye-backports
- name: Upgrade redis-server to the latest version from bullseye-backports on Debian 11
apt:
name: redis-server
state: latest
default_release: bullseye-backports
when: ansible_distribution_major_version is version('11')
- name: Install corepack via npm on Debian 12
shell: npm install -g corepack
when: ansible_distribution_major_version is version('12')
- name: Fix permissions for corepack
ansible.builtin.file:
path: /usr/local/lib/node_modules/
state: directory
mode: o+rx
recurse: yes
when: ansible_distribution_major_version is version('12')
- name: Enable yarn (via corepack)
shell: "corepack enable; yarn set version classic"