jebovic.nodejs

NodeJS

Build-Status Ansible-Galaxy

Installieren und Konfigurieren von NodeJS

Diese Rolle ist Teil meines OPS-Projekts. Folgen Sie diesem Link, um es in Aktion zu sehen. OPS bietet viele Funktionen, wie eine Vagrant-Datei für Entwicklungs-VMs, Playbooks für die Orchestrierung von Rollen, Inventardateien, Beispiele für die Konfiguration von Rollen, eine Ansible-Konfigurationsdatei und vieles mehr.

Kompatibilität

Getestet und genehmigt auf:

  • Debian jessie (8+)
  • Ubuntu Trusty (14.04 LTS)
  • Ubuntu Xenial (16.04 LTS)

Rollenvariablen

# NodeJS Installationskonfiguration
nodejs_apt_key_url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
nodejs_apt_repositories:
  - "deb https://deb.nodesource.com/node_{{ nodejs_major_version }} {{ ansible_distribution_release | lower }} main"
  - "deb-src https://deb.nodesource.com/node_{{ nodejs_major_version }} {{ ansible_distribution_release | lower }} main"
nodejs_packages:
  - nodejs
nodejs_major_version: 6.x # wähle zwischen 4.x und 6.x

# npm Grundkonfiguration
nodejs_npm_config_path: /usr/local/lib/npm
nodejs_npm_config_unsafe_perm: "false"
nodejs_npm_user: root
nodejs_npm_usergroup: root
nodejs_npm_packages:
  - name: npm
    version: latest

Beispiel-Playbook

- hosts: servers
  roles:
     - { role: jebovic.nodejs }

Beispiel: Konfiguration

# Anpassung der NodeJS-Version und Benutzer
nodejs_major_version: 4.x
nodejs_npm_user: me
nodejs_npm_usergroup: me

Tags

  • nodejs_config : aktualisiere nur die Konfiguration
  • nodejs_npm_addons : installiere nur zusätzliche npm-Pakete

Lizenz

MIT

Autoreninformation

Jérémy Baumgarth https://github.com/jebovic

Über das Projekt

Install and configure NodeJS

Installieren
ansible-galaxy install jebovic.nodejs
GitHub Repository
Lizenz
mit
Downloads
763