first test disk service pipeline
This commit is contained in:
15
roles/storage_api/tasks/build_py_bin.yaml
Normal file
15
roles/storage_api/tasks/build_py_bin.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Create directory structure
|
||||
ansible.windows.win_file:
|
||||
path: "{{ python_service_root }}"
|
||||
state: directory
|
||||
|
||||
- name: Copy disk_service.py
|
||||
ansible.windows.win_copy:
|
||||
src: disk_service.py
|
||||
dest: "{{ python_service_root }}\disk_service.py"
|
||||
|
||||
|
||||
|
||||
...
|
||||
17
roles/storage_api/tasks/main.yaml
Normal file
17
roles/storage_api/tasks/main.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
|
||||
###############################################
|
||||
# Disk API Windows Service
|
||||
###############################################
|
||||
|
||||
- name: set up python venv
|
||||
include_tasks: python_venv.yaml
|
||||
|
||||
- name: build python exe
|
||||
include_tasks: build_py_bin.yaml
|
||||
|
||||
#- name: set up nssm service
|
||||
# include_tasks: nssm.yaml
|
||||
|
||||
|
||||
...
|
||||
13
roles/storage_api/tasks/nssm.yaml
Normal file
13
roles/storage_api/tasks/nssm.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
|
||||
- name: Install nssm
|
||||
win_chocolatey:
|
||||
name: nssm
|
||||
state: present
|
||||
|
||||
- name: Install the foo service
|
||||
community.windows.win_nssm:
|
||||
name: foo
|
||||
application: C:\windows\foo.exe
|
||||
|
||||
...
|
||||
31
roles/storage_api/tasks/python_venv.yaml
Normal file
31
roles/storage_api/tasks/python_venv.yaml
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
|
||||
- name: Ensure Python is installed
|
||||
win_chocolatey:
|
||||
name: python
|
||||
state: present
|
||||
|
||||
- name: Create venv folder
|
||||
ansible.windows.win_file:
|
||||
path: "{{ python_venv }}"
|
||||
state: directory
|
||||
|
||||
- name: Copy requirements.txt
|
||||
ansible.windows.win_copy:
|
||||
src: requirements.txt
|
||||
dest: "{{ python_venv }}\requirements.txt"
|
||||
|
||||
- name: Create virtual environment
|
||||
win_shell: "py -m venv {{ python_venv }}"
|
||||
|
||||
- name: Upgrade pip in the virtual environment
|
||||
win_shell: "{{ python_venv }}\pip install --upgrade pip"
|
||||
args:
|
||||
chdir: "{{ python_venv }}"
|
||||
|
||||
- name: Install Python dependencies from requirements.txt
|
||||
win_shell: "{{ python_venv }}\pip install -r {{ python_venv }}\requirements.txt"
|
||||
args:
|
||||
chdir: "{{ python_venv }}"
|
||||
|
||||
...
|
||||
Reference in New Issue
Block a user