mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Modernize Yarn install w/ signed apt/PPA key
This commit is contained in:
parent
6d9c2cf4a0
commit
e0251f0ce9
1 changed files with 30 additions and 19 deletions
|
@ -1,30 +1,41 @@
|
|||
- name: "Yarn | GPG"
|
||||
apt_key:
|
||||
url: https://dl.yarnpkg.com/debian/pubkey.gpg
|
||||
state: present
|
||||
- name: Yarn | Download apt key to /usr/share/keyrings/yarn.gpg
|
||||
shell: curl https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarn.gpg
|
||||
|
||||
- name: "Yarn | Ensure Debian sources list file exists"
|
||||
file:
|
||||
path: /etc/apt/sources.list.d/yarn.list
|
||||
owner: root
|
||||
mode: '0644'
|
||||
state: touch
|
||||
- name: Yarn | Add signed Yarn PPA to /etc/apt/sources.list.d/dl_yarnpkg_com_debian.list
|
||||
apt_repository:
|
||||
repo: "deb [signed-by=/usr/share/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main"
|
||||
#filename: yarn # If legacy filename yarn.list is preferred
|
||||
|
||||
- name: "Yarn | Ensure Debian package is in sources list"
|
||||
lineinfile:
|
||||
dest: /etc/apt/sources.list.d/yarn.list
|
||||
regexp: 'deb https://dl.yarnpkg.com/debian/ stable main'
|
||||
line: 'deb https://dl.yarnpkg.com/debian/ stable main'
|
||||
state: present
|
||||
# 2023-04-01 above avoids DEPRECATED apt-key command & associated problems:
|
||||
# https://github.com/iiab/iiab/wiki/IIAB-Platforms#etcapttrustedgpg-legacy-keyring-warnings
|
||||
|
||||
- name: "Yarn | Update APT cache"
|
||||
# - name: "Yarn | GPG"
|
||||
# apt_key:
|
||||
# url: https://dl.yarnpkg.com/debian/pubkey.gpg
|
||||
# state: present
|
||||
|
||||
# - name: "Yarn | Ensure Debian sources list file exists"
|
||||
# file:
|
||||
# path: /etc/apt/sources.list.d/yarn.list
|
||||
# owner: root
|
||||
# mode: '0644'
|
||||
# state: touch
|
||||
|
||||
# - name: "Yarn | Ensure Debian package is in sources list"
|
||||
# lineinfile:
|
||||
# dest: /etc/apt/sources.list.d/yarn.list
|
||||
# regexp: 'deb https://dl.yarnpkg.com/debian/ stable main'
|
||||
# line: 'deb https://dl.yarnpkg.com/debian/ stable main'
|
||||
# state: present
|
||||
|
||||
- name: Yarn | Update APT cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: "Yarn | Install"
|
||||
- name: Yarn | Install
|
||||
package:
|
||||
name: yarn
|
||||
state: latest
|
||||
#state: latest # No need to mention it, with apt
|
||||
|
||||
|
||||
# RECORD Yarn AS INSTALLED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue