gitops/playbooks/deploy_nodejs_vhosts.yml
Haitao Pan fae2d7b4d7 playbooks: add mail stack, firewall, and nodejs deployment
Mail Stack Deployment:
- playbooks/deploy_mail_stack.yml: Complete mail server with chasquid + dovecot + firewall
  * Deploys chasquid SMTP server
  * Deploys dovecot IMAP server
  * Includes firewall configuration
  * Email test with swaks
  * Configurable domain, certificates, DKIM

- playbooks/deploy_mail_firewall.yml: Standalone firewall deployment
  * Just the firewall role
  * For servers that only need firewall rules
  * Customizable via variables

Node.js Deployment:
- playbooks/deploy_nodejs_vhosts.yml: Node.js runtime for vhosts
  * Installs Node.js 20.x from NodeSource
  * Configurable version and packages
  * Can install additional global npm packages
  * Supports Yarn installation

Inventory:
- playbooks/inventory.ini: Updated inventory file
  * Mail server and nodejs host groups
  * Example configuration

Scripts:
- scripts/netcheck.sh: Network connectivity check script

All playbooks:
- Use become: yes for privilege escalation
- Include comprehensive variable documentation
- Support customization via vars
- Include security best practices

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 20:54:38 +08:00

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: "20.x" (LTS), "18.x", "22.x", or specific version like "20.11.0"
nodejs_version: "20.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