38 lines
945 B
YAML
38 lines
945 B
YAML
---
|
|
- name: Configure Node.js runtime for vhosts
|
|
hosts: all
|
|
gather_facts: true
|
|
become: yes
|
|
vars:
|
|
# Choose Node.js version
|
|
# Examples: "22.x" (LTS), "20.x", "18.x", or specific version like "20.11.0"
|
|
nodejs_version: "22.x"
|
|
|
|
# Install Yarn package manager (default: true)
|
|
# install_yarn: false
|
|
|
|
# Add npm global bin to PATH (default: true)
|
|
# add_npm_to_path: true
|
|
|
|
# Custom npm prefix
|
|
# npm_config_prefix: "/usr/local/lib/npm"
|
|
|
|
# Additional packages to install globally (optional)
|
|
# global_npm_packages:
|
|
# - pm2
|
|
# - typescript
|
|
# - eslint
|
|
# - @angular/cli
|
|
|
|
roles:
|
|
- role: vhosts/nodejs
|
|
|
|
post_tasks:
|
|
- name: Install additional global npm packages
|
|
npm:
|
|
name: "{{ item }}"
|
|
state: latest
|
|
global: yes
|
|
loop: "{{ global_npm_packages | default([]) }}"
|
|
when: global_npm_packages is defined and global_npm_packages | length > 0
|