2018-04-06 09:19:36 +02:00
|
|
|
---
|
|
|
|
|
2021-06-08 11:19:26 +02:00
|
|
|
- name: Yarn GPG key is installed
|
2023-03-19 11:44:53 +01:00
|
|
|
ansible.builtin.copy:
|
2021-06-08 11:19:26 +02:00
|
|
|
src: yarn.asc
|
2022-11-02 23:15:17 +01:00
|
|
|
dest: "{{ apt_keyring_dir }}/yarn.asc"
|
2021-05-26 13:47:34 +02:00
|
|
|
mode: "0644"
|
|
|
|
owner: root
|
|
|
|
group: root
|
2018-04-06 09:19:36 +02:00
|
|
|
tags:
|
|
|
|
- system
|
|
|
|
- packages
|
|
|
|
- nodejs
|
|
|
|
- yarn
|
|
|
|
|
2023-03-19 11:44:53 +01:00
|
|
|
- name: Add Yarn repository (Debian <12)
|
|
|
|
ansible.builtin.apt_repository:
|
2022-11-02 23:17:08 +01:00
|
|
|
repo: "deb [signed-by={{ apt_keyring_dir }}/yarn.asc] https://dl.yarnpkg.com/debian/ stable main"
|
2018-04-06 09:19:36 +02:00
|
|
|
filename: yarn
|
|
|
|
state: present
|
|
|
|
tags:
|
|
|
|
- system
|
|
|
|
- packages
|
|
|
|
- nodejs
|
|
|
|
- yarn
|
2023-03-19 11:44:53 +01:00
|
|
|
when: ansible_distribution_major_version is version('12', '<')
|
2018-04-06 09:19:36 +02:00
|
|
|
|
2023-03-19 11:44:53 +01:00
|
|
|
- name: Add Yarn repository (Debian >=12)
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: yarn.sources.j2
|
|
|
|
dest: /etc/apt/sources.list.d/yarn.sources
|
|
|
|
state: present
|
2022-12-02 15:17:42 +01:00
|
|
|
update_cache: yes
|
2023-03-19 11:44:53 +01:00
|
|
|
register: yarn_sources
|
2022-12-02 15:17:42 +01:00
|
|
|
tags:
|
|
|
|
- system
|
|
|
|
- packages
|
|
|
|
- nodejs
|
|
|
|
- yarn
|
2023-03-19 11:44:53 +01:00
|
|
|
when: ansible_distribution_major_version is version('12', '>=')
|
|
|
|
|
|
|
|
- name: Update APT cache
|
|
|
|
ansible.builtin.apt:
|
|
|
|
update_cache: yes
|
|
|
|
when: yarn_sources is changed
|
2022-12-02 15:17:42 +01:00
|
|
|
|
2021-06-08 11:19:26 +02:00
|
|
|
- name: Yarn is installed
|
2023-03-19 11:44:53 +01:00
|
|
|
ansible.builtin.apt:
|
2018-04-06 09:19:36 +02:00
|
|
|
name: yarn
|
|
|
|
state: present
|
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
- nodejs
|
|
|
|
- yarn
|