Last active
May 1, 2025 17:17
-
-
Save anujdevopslearn/b27a865719f60cf02c2c5fe7a6513a11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: webservers | |
tasks: | |
- name: Install Python package | |
apt: | |
pkg: | |
- python3 | |
- unzip | |
- python3-pip | |
- name: Copy Python code on Application servers | |
get_url: url="https://github.com/anujdevopslearn/PythonServer/archive/refs/heads/main.zip" dest=/tmp/artifact.zip | |
- name: Extract Code | |
unarchive: src=/tmp/artifact.zip dest=/opt/ remote_src=True | |
- name: Run Python Code | |
shell: | | |
pip3 install -r requirements.txt --break-system-packages | |
nohup python3 app.py & | |
args: | |
chdir: /opt/PythonServer-main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
public