Hello and welcome to the community!
tasks:
- name: "Download jmespath"
ansible.builtin.shell:
executable: "/bin/bash"
cmd: |
set -o pipefail
python3 -m pip \
download jmespath \
--dest /tmp/ \
--no-input \
| grep /
become: false
changed_when: false
check_mode: false
delegate_to: "localhost"
register: "pip_download_jmespath"
- name: "Copy jmespath"
ansible.builtin.copy:
src: "{{ pip_download_jmespath.stdout.split(' ')[-1] }}"
dest: "/tmp/jmespath/"
mode: "0664"
- name: "Install jmespath from downloaded package"
ansible.builtin.pip:
name: "jmespath"
extra_args: >
--no-index --find-links=file:///tmp/jmespath/
when: "not ansible_check_mode"