diff --git a/roles/soctools-server/tasks/main.yml b/roles/soctools-server/tasks/main.yml index 53d010664068218763186c5598b32c5e68678600..da0b59fa2d342f1b006ca592ae663b87be7be2a8 100644 --- a/roles/soctools-server/tasks/main.yml +++ b/roles/soctools-server/tasks/main.yml @@ -22,15 +22,15 @@ name: ["pexpect==3.3"] - name: create venv for user-mgmt-ui - shell: 'python3 -m venv user-mgmt-ui' + shell: 'python3 -m venv venv' args: - chdir: '{{playbook_dir}}' + chdir: '{{playbook_dir}}/user-mgmt-ui' warn: no - name: install venv packages for user-mgmt-ui - shell: './user-mgmt-ui/bin/python3 -m pip install gunicorn flask flask-wtf email_validator' + shell: './venv/bin/python3 -m pip install -r requirements.txt' args: - chdir: '{{playbook_dir}}' + chdir: '{{playbook_dir}}/user-mgmt-ui' warn: no - name: create systemd service file for user-mgmt-ui diff --git a/roles/soctools-server/templates/user-mgmt-ui.service.j2 b/roles/soctools-server/templates/user-mgmt-ui.service.j2 index 6e3ec4529a8415bd5d374f719f82316b03d19bfd..dde0c4ee833baa507fb60b2d4a7a0becbe395765 100644 --- a/roles/soctools-server/templates/user-mgmt-ui.service.j2 +++ b/roles/soctools-server/templates/user-mgmt-ui.service.j2 @@ -5,7 +5,7 @@ After=syslog.target network.target [Service] Type=simple -ExecStart={{playbook_dir}}/user-mgmt-ui/bin/gunicorn --workers=2 --bind 0.0.0.0:8050 main:app +ExecStart={{playbook_dir}}/user-mgmt-ui/venv/bin/gunicorn --workers=2 --bind 0.0.0.0:8050 main:app User=root KillMode=process WorkingDirectory={{playbook_dir}}/user-mgmt-ui