infra/roles/up1/tasks/main.yml

53 lines
922 B
YAML
Raw Normal View History

2020-10-02 23:31:41 +02:00
---
- name: ensure lufi user is present
user:
name: "up1"
home: "/srv/up1"
shell: "/bin/bash"
state: present
- name: Clone up1 repo
git:
repo: https://github.com/Upload/Up1
dest: /srv/up1/up1
become: true
become_user: up1
- name: copy server settings
template:
src: server.conf.j2
dest: /srv/up1/up1/server/server.conf
owner: up1
group: up1
mode: 0600
- name: copy client settings
template:
src: config.js.j2
dest: /srv/up1/up1/client/config.js
owner: up1
group: up1
mode: 0600
- name: Install up1 deps
become: true
become_user: up1
npm:
path: /srv/up1/up1/server
- name: NODE | Install pm2
npm:
name: pm2
global: yes
production: yes
state: present
- name: NODE | Start APP
become: true
become_user: up1
shell: pm2 start server.js --name server
args:
chdir: /srv/up1/up1/server
ignore_errors: yes