Ansible - run Python Flask Script in a new terminal window

I have a Flask application that I would like to deploy and start using Ansible. I already have my program installed to install all the necessary dependencies, but I had problems getting Ansible to run my application. I used commandand shell, both of which launch the Flask application, but block Ansible from exiting, and Flask does not appear in its own terminal window, which makes it difficult to visually debug and see what Flask does.

#Current playbook; both command and shell act the same way
  tasks:
  - command: python3 /home/user/Desktop/Flask/app.py
  - shell: python3 /home/user/Desktop/Flask/app.py

Q: How can I run Ansible to run a Flask script in my terminal window?


+4
source share
1 answer

gnu screen, . , script deploy, , :

- name: Invoke reset script
  command: /usr/bin/screen -d -m sudo -u deploy /usr/local/bin/do-reset.sh -i -y reset 
  async: True
  poll: 0

-d -m , , async poll Ansible .

+3

All Articles