From c8d88286df8e58df6ffcc87cda7a4482a5c57092 Mon Sep 17 00:00:00 2001 From: Samuel Mutel <12967891+smutel@users.noreply.github.com> Date: Mon, 21 Mar 2022 18:18:37 +0100 Subject: [PATCH] enh: Use latest pip/setuptools in virtualenv --- tasks/deploy_netbox.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tasks/deploy_netbox.yml b/tasks/deploy_netbox.yml index 996103f..866f225 100644 --- a/tasks/deploy_netbox.yml +++ b/tasks/deploy_netbox.yml @@ -27,12 +27,25 @@ owner: "{{ netbox_user }}" group: "{{ netbox_group }}" -- name: Create NetBox virtualenv and install needed Python dependencies +- name: Create NetBox virtualenv + pip: + name: + - pip + - setuptools + state: latest + virtualenv: "{{ netbox_virtualenv_path }}" + virtualenv_command: "{{ netbox_python_binary }} -m venv" + become: true + become_user: "{{ netbox_user }}" + retries: 2 + register: _netbox_virtualenv_setup + until: _netbox_virtualenv_setup is succeeded + +- name: Install needed Python dependencies pip: requirements: "{{ netbox_current_path }}/requirements.txt" extra_args: "-c {{ netbox_current_path }}/constraints.txt" virtualenv: "{{ netbox_virtualenv_path }}" - virtualenv_command: "{{ netbox_python_binary }} -m venv" become: true become_user: "{{ netbox_user }}" retries: 2