---
- name: 'Download eget from url "{{ eget_download_url }}"'
  ansible.builtin.get_url:
    url: '{{ eget_download_url }}'
    dest: '{{ eget_download_dest }}'
    mode: '0600'

- name: 'Unarchive eget'
  ansible.builtin.unarchive:
    src: '{{ eget_download_dest }}'
    dest: '/tmp'
    list_files: true
    remote_src: true

- name: 'Install eget binary'
  ansible.builtin.copy:
    src: '{{ (eget_unarchive_dest, "eget") | path_join }}'
    dest: '{{ eget_install_path }}'
    mode: '0755'
    remote_src: true

- name: 'Remove temporary files'
  ansible.builtin.file:
    path: '{{ eget_download_dest }}'
    state: absent

- name: 'Remove temporary directories'
  ansible.builtin.file:
    path: '{{ eget_unarchive_dest }}'
    state: absent