fubarhouse.pm2
Ansible Role: PM2
- Install PM2 to any desired location - A node application manager
- Clone/Pull node applications from remote repositories
- Install node packages required for each specified application
- Copy configuration files
- Create databases
- Import database files
- Run initialization script
- Start application, and wait for response
- Flush logs
Requirements
None.
Role Variables
To cleanly install PM2, use pm2_clean_install.
pm2_clean_install: true
Configure each node application as an array item in node_apps.
This unique configuration is required by you, otherwise this role will not install any services into the PM2 daemon.
node_apps:
- name: myApp
port: 3000
location: /opt/myapp
start: app.js
init: reset.js
repository: ssh://[email protected]/mybitbucket/myapp.git
database:
name: myapp
file: database.sql
config:
origin: config/local-example.js
destination: config/local.js
Dependencies
- None.
Example Playbook
- { role: fubarhouse.pm2 }
Installation
- Add the PM2 role to your playbook.
- Modify above variables as desired.
License
MIT / BSD
Author Information
This role was created in 2016 by Karl Hepworth.
Install
ansible-galaxy install fubarhouse.pm2License
mit
Downloads
123
Owner
I love open source, and computers - both hardware and software. Privacy advocate. Any opinions outside of official communications and representation are my own.
