Skip to content Skip to sidebar Skip to footer

Ansible - Start Python Flask Script In New Terminal Window

I have a Flask app that I'd like to deploy and start using Ansible. I've already got my playbook setup to install all the dependencies needed but I'm having trouble getting Ansible

Solution 1:

If you have gnu screen installed on this system then you can use it to background tasks. I use this to run a shell script asynchronously as the deploy user so that I can log in later and see how it's doing:

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

The -d -m parameters tell screen to start up in detached mode, and the async and poll settings tell Ansible to background the command and forget about it.

Post a Comment for "Ansible - Start Python Flask Script In New Terminal Window"