- 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
None.
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://git@bitbucket.org/mybitbucket/myapp.git
database:
name: myapp
file: database.sql
config:
origin: config/local-example.js
destination: config/local.js
- None.
- { role: fubarhouse.pm2 }
- Add the PM2 role to your playbook.
- Modify above variables as desired.
MIT / BSD
This role was created in 2016 by Karl Hepworth.