Skip to content

Commit 7b43c62

Browse files
committed
virtualenv
1 parent 80e3b1e commit 7b43c62

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

roles/semaphore/tasks/present.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,22 @@
121121
mode: '0640'
122122
notify: Restart semaphore
123123

124-
- name: Create virtual environment and install requirements into it
124+
- name: Create virtual environment
125+
become: true
126+
become_user: semaphore
127+
ansible.builtin.command:
128+
args:
129+
cmd: python3.12 -m venv venv
130+
chdir: /home/semaphore
131+
creates: /home/semaphore/venv/bin/pip
132+
133+
- name: Install python libraries
125134
become: true
126135
become_user: semaphore
127136
ansible.builtin.pip:
128137
requirements: '/home/semaphore/requirements.txt'
129-
virtualenv: '/home/semaphore/venv'
130-
virtualenv_python: python3.12
131-
state: present
138+
executable: '/home/semaphore/venv/bin/pip'
139+
state: present # or 'latest' to upgrade the requirements
132140
notify: Restart semaphore
133141

134142
- name: Deploy Semaphore Config

0 commit comments

Comments
 (0)