- name: create actions_runner directory
  ansible.builtin.file:
    path: actions_runner
    state: directory
    mode: '0755'

- name: download latest runner package
  ansible.builtin.get_url:
    url: "https://github.com/actions/runner/releases/download/v{{runner_version}}/actions-runner-linux-x64-{{runner_version}}.tar.gz"
    dest: "actions_runner/actions_runner.tar.gz"
    mode: '0755'
    timeout: 15

- name: unpack compressed actions_runner
  ansible.builtin.unarchive:
    src: /home/ansible/actions_runner/actions_runner.tar.gz
    dest: /home/ansible/actions_runner
    remote_src: yes
