--- - name: Ensure python3-venv is installed ansible.builtin.apt: name: python3-venv state: present become: true - name: Create a virtualenv for Docker SDK ansible.builtin.command: cmd: python3 -m venv /opt/docker-venv creates: /opt/docker-venv - name: Install packages in the virtualenv ansible.builtin.pip: virtualenv: /opt/docker-venv name: - docker - requests - jsondiff - packaging # - name: Install pipx # ansible.builtin.apt: # name: pipx # state: absent # - name: Ensure pipx binary path is available # ansible.builtin.shell: pipx ensurepath # - name: Ensure pip is installed # ansible.builtin.package: # name: # - python3 # - python3-pip # state: present # become: true