ansible-role-nodejs/tasks/main.yml

22 lines
449 B
YAML

---
- name: Install npm and yarn (Debian)
import_tasks: Debian.yml
when: ansible_os_family == 'Debian'
- name: Install npm and yarn (non-Debian)
ansible.builtin.package:
name:
- nodejs
- yarn
state: present
when: ansible_os_family != 'Debian'
- name: Install npm requirements
ansible.builtin.npm:
name: "{{ item }}"
global: yes
state: present
loop: "{{ npm_packages }}"
when: npm_packages is defined