Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/ympc-app/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dependencies:
- { role: nodesource.node }
- { role: redis }
- { role: nginx }
- { role: ympc-user }
7 changes: 7 additions & 0 deletions roles/ympc-app/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
retries: 5
delay: 2

- name: update ownership
file:
path={{ APP_INSTALL_PATH }}
owner={{ YMPC_USER }}
group={{ YMPC_USER }}
recurse=yes

- name: deploy config file
template: src=config.j2 dest={{ APP_CONFIG_PATH }}

Expand Down
2 changes: 2 additions & 0 deletions roles/ympc-app/templates/systemd-unit.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ Environment="YO_PORT={{APP_PORT}}"
Environment="YO_APIKEY={{YO_APIKEY}}"
Restart=always
ExecStart=/usr/bin/node {{ APP_INSTALL_PATH }}/server.js
User={{ YMPC_USER }}
Group={{ YMPC_USER }}
1 change: 1 addition & 0 deletions roles/ympc-dispatcher/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dependencies:
- { role: systemd }
- { role: nodesource.node }
- { role: redis }
- { role: ympc-user }
7 changes: 7 additions & 0 deletions roles/ympc-dispatcher/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
retries: 5
delay: 2

- name: update ownership
file:
path={{ DISPATCHER_INSTALL_PATH }}
owner={{ YMPC_USER }}
group={{ YMPC_USER }}
recurse=yes

- name: deploy config file
template: src=config.j2 dest={{ DISPATCHER_CONFIG_PATH }}

Expand Down
2 changes: 2 additions & 0 deletions roles/ympc-dispatcher/templates/systemd-unit.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Description=YOMYPOPCORN Dispatcher
Environment="YO_APIKEY={{YO_APIKEY}}"
Restart=always
ExecStart={{ DISPATCHER_INSTALL_PATH }}/bin/cli.js --debug info
User={{ YMPC_USER }}
Group={{ YMPC_USER }}
1 change: 1 addition & 0 deletions roles/ympc-kueui/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dependencies:
- { role: systemd }
- { role: nodesource.node }
- { role: redis }
- { role: ympc-user }
7 changes: 7 additions & 0 deletions roles/ympc-kueui/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
retries: 5
delay: 2

- name: update ownership
file:
path={{ KUEUI_INSTALL_PATH }}
owner={{ YMPC_USER }}
group={{ YMPC_USER }}
recurse=yes

- name: deploy config file
template: src=config.j2 dest={{ KUEUI_CONFIG_PATH }}

Expand Down
2 changes: 2 additions & 0 deletions roles/ympc-kueui/templates/systemd-unit.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ Description=YOMYPOPCORN Kue UI
[Service]
Restart=always
ExecStart={{ KUEUI_INSTALL_PATH }}/bin/cli.js --debug info
User={{ YMPC_USER }}
Group={{ YMPC_USER }}
1 change: 1 addition & 0 deletions roles/ympc-scanner/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dependencies:
- { role: systemd }
- { role: nodesource.node }
- { role: redis }
- { role: ympc-user }
7 changes: 7 additions & 0 deletions roles/ympc-scanner/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
retries: 5
delay: 2

- name: update ownership
file:
path={{ SCANNER_INSTALL_PATH }}
owner={{ YMPC_USER }}
group={{ YMPC_USER }}
recurse=yes

- name: deploy config file
template: src=config.j2 dest={{ SCANNER_CONFIG_PATH }}

Expand Down
2 changes: 2 additions & 0 deletions roles/ympc-scanner/templates/systemd-unit.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ Description=YOMYPOPCORN Scanner
[Service]
Restart=always
ExecStart={{ SCANNER_INSTALL_PATH }}/bin/cli.js --debug info
User={{ YMPC_USER }}
Group={{ YMPC_USER }}
9 changes: 9 additions & 0 deletions roles/ympc-user/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: create user
user:
state=present
name={{ YMPC_USER }}
comment="YOMYPOPCORN apps"
system=yes
home={{ BASE_INSTALL_PATH }}
shell=/bin/false
4 changes: 3 additions & 1 deletion vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ ADMINS:
- teuteberg
- MathisB

BASE_INSTALL_PATH: /root/yomypopcorn
YMPC_USER: ympc

BASE_INSTALL_PATH: /opt/yomypopcorn

# app
APP_SERVICE_NAME: ympc-app
Expand Down