From d4af8993f1a46dd9dff0d41f0dd4325f8bcf9a2a Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Tue, 7 Nov 2023 10:22:31 +0100 Subject: [PATCH] Add task to install pip packages --- tasks/install_pip.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tasks/install_pip.yml diff --git a/tasks/install_pip.yml b/tasks/install_pip.yml new file mode 100644 index 0000000..2bc51a6 --- /dev/null +++ b/tasks/install_pip.yml @@ -0,0 +1,27 @@ +--- +# workaround for ansible semaphore +# usage for a playobook from the playbooks directory: +# +# - hosts: localhost +# name: "Dummy plug on localhost" +# gather_facts: false +# connection: local +# tasks: +# - name: "Install pip packages" +# ansible.builtin.import_tasks: +# file: "../tasks/install_pip.yml" + +- name: "Make sure pip is installed" + ansible.builtin.command: "{{ ansible_python_interpreter }} -m ensurepip --upgrade" + register: pip_installed + changed_when: pip_installed.rc != 0 + +- name: "Make sure pip packages are installed" + ansible.builtin.pip: + name: "{{ item }}" + state: present + with_items: + - proxmoxer + - requests + - jmespath + - netaddr