Files
ansible_role_package/tasks/pkgs/nodejs.yml
2026-03-03 15:08:15 -07:00

28 lines
1008 B
YAML

# vim: set filetype=yaml.ansible :
---
- name: Configure nodejs
when:
- "'nodejs' not in __configured"
block:
- name: Set nodejs install method
when:
- nodejs_install_method is undefined
ansible.builtin.set_fact:
nodejs_install_method: "{{ install_method if install_method in nodejs.install_methods else nodejs.install_methods[0] }}"
- name: Configure nodejs system install
when:
- nodejs_install_method == "system"
block:
- name: Set nodejs package name
ansible.builtin.set_fact:
nodejs_pkgname: "{{ nodejs.pkgname[system] }}"
nodejs_deps: "{{ nodejs.pkg_deps[system] | default([]) }}"
- name: Append nodejs to pkg_sys
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + [nodejs_pkgname] + nodejs_deps }}"
- name: Finalize nodejs configuration
ansible.builtin.set_fact:
__configured: "{{ __configured | combine( { 'nodejs': nodejs_install_method } ) }}"