فهرست منبع

add port to system service, restart on modification, add basic script to launch with env vars

David 10 سال پیش
والد
کامیت
669c821540
3فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 1 1
      roles/setup_daemons/tasks/main.yml
  2. 4 0
      scripts/add-senora.sh
  3. 1 1
      templates/backend.service

+ 1 - 1
roles/setup_daemons/tasks/main.yml

@@ -10,7 +10,7 @@
   shell: systemctl enable backend-{{client_username}}.service
 
 - name: start user {{client_username}} daemon
-  shell: systemctl start backend-{{client_username}}.service
+  shell: systemctl restart backend-{{client_username}}.service
 
 #- name: reload systemds daemons
 #  systemd:

+ 4 - 0
scripts/add-senora.sh

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+#IP, USER, PORT
+ansible-playbook add-senora.yml -i 208.68.38.138, -e "client_username=martita client_port=8001" 

+ 1 - 1
templates/backend.service

@@ -7,7 +7,7 @@ Requires=networking.service
 User={{ client_username }}
 TimeoutStartSec=0
 WorkingDirectory=/home/{{ client_username }}/consultorio_backend/back/
-ExecStart=/usr/bin/python3 app.py
+ExecStart=/usr/bin/python3 app.py {{ client_port }}
 
 [Install]
 WantedBy=multi-user.target