---

- name: yarn GPG key is installed
  apt_key:
    # url: https://dl.yarnpkg.com/debian/pubkey.gpg
    data: "{{ lookup('file', 'yarnpkg.gpg.key') }}"
  tags:
    - system
    - packages
    - nodejs
    - yarn

- name: yarn sources list is available
  apt_repository:
    repo: "deb https://dl.yarnpkg.com/debian/ stable main"
    filename: yarn
    update_cache: yes
    state: present
  tags:
    - system
    - packages
    - nodejs
    - yarn

- name: yarn is installed
  apt:
    name: yarn
    state: present
  tags:
    - packages
    - nodejs
    - yarn
