Browse Source

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

David 10 years atrás
parent
commit
669c821540
3 changed files with 6 additions and 2 deletions
  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