| - name: Download and extract Depot |
| block: |
| - name: Create a temporary file |
| ansible.builtin.tempfile: |
| prefix: hatch |
| suffix: .tar.gz |
| state: file |
| register: ensure_hatch_tar |
| |
| - name: Download Hatch release |
| ansible.builtin.get_url: |
| url: https://github.com/pypa/hatch/releases/download/hatch-v{{ ensure_hatch_version }}/hatch-x86_64-unknown-linux-gnu.tar.gz |
| dest: "{{ ensure_hatch_tar.path }}" |
| force: true |
| |
| - name: Extract into {{ ensure_hatch_path }} |
| become: true |
| ansible.builtin.unarchive: |
| src: "{{ ensure_hatch_tar.path }}" |
| dest: "{{ ensure_hatch_path }}" |
| remote_src: yes |
| always: |
| - name: Remove the temporary file |
| ansible.builtin.file: |
| path: "{{ ensure_hatch_tar.path }}" |
| state: absent |
| |
| - name: Assert that Hatch is functional |
| ansible.builtin.command: hatch --version |